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
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
title: "애니 다운로더"
|
title: "애니 다운로더"
|
||||||
version: 0.7.20
|
version: 0.7.21
|
||||||
package_name: "anime_downloader"
|
package_name: "anime_downloader"
|
||||||
developer: "projectdx"
|
developer: "projectdx"
|
||||||
description: "anime downloader"
|
description: "anime downloader"
|
||||||
|
|||||||
+12
-3
@@ -628,11 +628,13 @@ class LogicOhli24(AnimeModuleBase):
|
|||||||
elif sub == "queue_list":
|
elif sub == "queue_list":
|
||||||
return jsonify([])
|
return jsonify([])
|
||||||
elif sub == "queue_command":
|
elif sub == "queue_command":
|
||||||
command = req.form["command"]
|
command = req.form.get("command", "")
|
||||||
entity_id = req.form["entity_id"]
|
entity_id = req.form.get("entity_id", "")
|
||||||
|
|
||||||
if ModuleQueue:
|
if ModuleQueue:
|
||||||
if command == "stop" or command == "cancel":
|
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
|
# Create a mock request object for GDM cancel as req.form is often immutable
|
||||||
class MockRequest:
|
class MockRequest:
|
||||||
def __init__(self, form_data):
|
def __init__(self, form_data):
|
||||||
@@ -667,6 +669,13 @@ class LogicOhli24(AnimeModuleBase):
|
|||||||
# 하지만 강제 초기화이므로 제거 시도
|
# 하지만 강제 초기화이므로 제거 시도
|
||||||
cancelled_count += 1
|
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도 정리
|
# Ohli24 DB도 정리
|
||||||
try:
|
try:
|
||||||
from framework import F
|
from framework import F
|
||||||
@@ -688,7 +697,7 @@ class LogicOhli24(AnimeModuleBase):
|
|||||||
return jsonify({'ret':'success', 'log':'완료 항목이 삭제되었습니다.'})
|
return jsonify({'ret':'success', 'log':'완료 항목이 삭제되었습니다.'})
|
||||||
|
|
||||||
if self.queue:
|
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)
|
||||||
return jsonify({'ret':'error', 'msg':'Queue not initialized'})
|
return jsonify({'ret':'error', 'msg':'Queue not initialized'})
|
||||||
elif sub == "add_queue_checked_list":
|
elif sub == "add_queue_checked_list":
|
||||||
|
|||||||
Reference in New Issue
Block a user