From 5a230e20f711e7454f56e3e382013d41ba7173c0 Mon Sep 17 00:00:00 2001 From: projectdx Date: Thu, 26 Mar 2026 22:07:04 +0900 Subject: [PATCH] fix(ohli24): handle queue reset without entity id - accept queue reset requests without entity_id - clear the runtime queue during reset to avoid stale UI state - bump patch version to 0.7.21 --- info.yaml | 2 +- mod_ohli24.py | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/info.yaml b/info.yaml index a4ccc7f..f075549 100644 --- a/info.yaml +++ b/info.yaml @@ -1,5 +1,5 @@ title: "애니 다운로더" -version: 0.7.20 +version: 0.7.21 package_name: "anime_downloader" developer: "projectdx" description: "anime downloader" diff --git a/mod_ohli24.py b/mod_ohli24.py index 0ab2f0c..5a0143b 100644 --- a/mod_ohli24.py +++ b/mod_ohli24.py @@ -628,11 +628,13 @@ class LogicOhli24(AnimeModuleBase): elif sub == "queue_list": return jsonify([]) elif sub == "queue_command": - command = req.form["command"] - entity_id = req.form["entity_id"] + command = req.form.get("command", "") + entity_id = req.form.get("entity_id", "") if ModuleQueue: if command == "stop" or command == "cancel": + if not entity_id: + return jsonify({'ret': 'error', 'msg': 'entity_id required'}) # Create a mock request object for GDM cancel as req.form is often immutable class MockRequest: def __init__(self, form_data): @@ -666,6 +668,13 @@ class LogicOhli24(AnimeModuleBase): # GDM 내부 클린업은 cancel()이 담당하므로 여기서 del은 신중해야 함 # 하지만 강제 초기화이므로 제거 시도 cancelled_count += 1 + + # 자체 큐/메모리 리스트도 함께 초기화해서 UI 잔상을 남기지 않음 + if self.queue: + try: + self.queue.command("reset", 0) + except Exception as e: + logger.error(f"Failed to reset Ohli24 runtime queue: {e}") # Ohli24 DB도 정리 try: @@ -688,7 +697,7 @@ class LogicOhli24(AnimeModuleBase): return jsonify({'ret':'success', 'log':'완료 항목이 삭제되었습니다.'}) if self.queue: - ret = self.queue.command(command, int(entity_id)) + ret = self.queue.command(command, int(entity_id) if str(entity_id).isdigit() else 0) return jsonify(ret) return jsonify({'ret':'error', 'msg':'Queue not initialized'}) elif sub == "add_queue_checked_list":