diff --git a/__pycache__/__init__.cpython-310.pyc b/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..3e1a315 Binary files /dev/null and b/__pycache__/__init__.cpython-310.pyc differ diff --git a/__pycache__/logic.cpython-310.pyc b/__pycache__/logic.cpython-310.pyc new file mode 100644 index 0000000..626e6e1 Binary files /dev/null and b/__pycache__/logic.cpython-310.pyc differ diff --git a/__pycache__/logic_linkkf.cpython-310.pyc b/__pycache__/logic_linkkf.cpython-310.pyc new file mode 100644 index 0000000..e49bdf2 Binary files /dev/null and b/__pycache__/logic_linkkf.cpython-310.pyc differ diff --git a/__pycache__/logic_queue.cpython-310.pyc b/__pycache__/logic_queue.cpython-310.pyc new file mode 100644 index 0000000..31e498d Binary files /dev/null and b/__pycache__/logic_queue.cpython-310.pyc differ diff --git a/__pycache__/mod_basic.cpython-310.pyc b/__pycache__/mod_basic.cpython-310.pyc new file mode 100644 index 0000000..345f5ab Binary files /dev/null and b/__pycache__/mod_basic.cpython-310.pyc differ diff --git a/__pycache__/model.cpython-310.pyc b/__pycache__/model.cpython-310.pyc new file mode 100644 index 0000000..7929416 Binary files /dev/null and b/__pycache__/model.cpython-310.pyc differ diff --git a/__pycache__/plugin.cpython-310.pyc b/__pycache__/plugin.cpython-310.pyc new file mode 100644 index 0000000..f7919f5 Binary files /dev/null and b/__pycache__/plugin.cpython-310.pyc differ diff --git a/__pycache__/setup.cpython-310.pyc b/__pycache__/setup.cpython-310.pyc new file mode 100644 index 0000000..f5b5202 Binary files /dev/null and b/__pycache__/setup.cpython-310.pyc differ diff --git a/__pycache__/subtitle_util.cpython-310.pyc b/__pycache__/subtitle_util.cpython-310.pyc new file mode 100644 index 0000000..f101a99 Binary files /dev/null and b/__pycache__/subtitle_util.cpython-310.pyc differ diff --git a/lib/__pycache__/utils.cpython-310.pyc b/lib/__pycache__/utils.cpython-310.pyc index db5b42d..7e1a3d8 100644 Binary files a/lib/__pycache__/utils.cpython-310.pyc and b/lib/__pycache__/utils.cpython-310.pyc differ diff --git a/logic_linkkf.py b/logic_linkkf.py index aa175fb..fbe2402 100644 --- a/logic_linkkf.py +++ b/logic_linkkf.py @@ -23,7 +23,7 @@ from .lib.utils import linkkf_async_timeit # import snoop # from snoop import spy -from framework import db, get_logger +from framework import F, db, get_logger from framework.util import Util # 패키지 @@ -1517,44 +1517,42 @@ class LogicLinkkf(object): @staticmethod def scheduler_function(): try: - logger.debug("Linkkf scheduler_function start..") + with F.app.app_context(): + logger.debug("Linkkf scheduler_function start..") - whitelist_program = ModelSetting.get("whitelist_program") - whitelist_programs = [ - x.strip().replace(" ", "") - for x in whitelist_program.replace("\n", ",").split(",") - ] + whitelist_program = ModelSetting.get("whitelist_program") or "" + whitelist_programs = [ + x.strip().replace(" ", "") + for x in whitelist_program.replace("\n", ",").split(",") + if x.strip() != "" + ] - logger.debug(f"whitelist_programs: {whitelist_programs}") + logger.debug(f"whitelist_programs: {whitelist_programs}") - for code in whitelist_programs: - logger.info("auto download start : %s", code) - downloaded = ( - db.session.query(ModelLinkkf) - .filter(ModelLinkkf.completed.is_(True)) - .filter_by(programcode=code) - .with_for_update() - .all() - ) - logger.debug(f"downloaded:: {downloaded}") - dl_codes = [dl.episodecode for dl in downloaded] - # logger.debug("dl_codes:: %s", dl_codes) - logger.info("downloaded codes :%s", dl_codes) + for code in whitelist_programs: + logger.info("auto download start : %s", code) + downloaded = ( + db.session.query(ModelLinkkf) + .filter(ModelLinkkf.completed.is_(True)) + .filter_by(programcode=code) + .with_for_update() + .all() + ) + logger.debug(f"downloaded:: {downloaded}") + dl_codes = [dl.episodecode for dl in downloaded] + logger.info("downloaded codes :%s", dl_codes) - # if len(dl_codes) > 0: - data = LogicLinkkf.get_title_info(code) - logger.debug(f"data:: {data}") + data = LogicLinkkf.get_title_info(code) + logger.debug(f"data:: {data}") - for episode in data["episode"]: - e_code = episode["code"] - if e_code not in dl_codes: - logger.info("Logic Queue added :%s", e_code) + for episode in data["episode"]: + e_code = episode["code"] + if e_code not in dl_codes: + logger.info("Logic Queue added :%s", e_code) + logger.debug(f"episode:: {episode}") + LogicQueue.add_queue(episode) - logger.debug(f"episode:: {episode}") - print("temp==============") - LogicQueue.add_queue(episode) - - logger.debug("========================================") + logger.debug("========================================") except Exception as e: logger.error("Exception:%s", e) logger.error(traceback.format_exc())