diff --git a/logic_anilife.py b/logic_anilife.py index 280fbd3..f8a3bd3 100644 --- a/logic_anilife.py +++ b/logic_anilife.py @@ -1,5 +1,6 @@ import os import sys +import threading import traceback import json from datetime import datetime @@ -812,6 +813,28 @@ class LogicAniLife(LogicModuleBase): req.form["command"], int(req.form["entity_id"]) ) return jsonify(ret) + elif sub == "add_queue_checked_list": + data = json.loads(request.form["data"]) + + def func(): + count = 0 + for tmp in data: + add_ret = self.add(tmp) + if add_ret.startswith("enqueue"): + self.socketio_callback("list_refresh", "") + count += 1 + notify = { + "type": "success", + "msg": "%s 개의 에피소드를 큐에 추가 하였습니다." % count, + } + socketio.emit( + "notify", notify, namespace="/framework", broadcast=True + ) + + thread = threading.Thread(target=func, args=()) + thread.daemon = True + thread.start() + return jsonify("") except Exception as e: P.logger.error("Exception:%s", e) @@ -1032,7 +1055,7 @@ class LogicAniLife(LogicModuleBase): entity["link"] = P.ModelSetting.get("anilife_url") + entity["link"] # real_url = LogicAniLife.get_real_link(url=entity["link"]) - logger.debug(entity["link"]) + # logger.debug(entity["link"]) entity["code"] = entity["link"].split("/")[-1] entity["title"] = item.xpath(".//div[@class='tt']/text()")[0].strip()