mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-12 15:20:44 +08:00
♻️ 优化任务插件选项读取逻辑
This commit is contained in:
parent
9d599b5e64
commit
10030346d0
@ -58,9 +58,11 @@ class Alist_strm_gen:
|
||||
self.strm_server = f"{self.url.strip()}/d"
|
||||
|
||||
def run(self, task, **kwargs):
|
||||
if task_config := task.get("addition", {}).get(self.plugin_name, {}):
|
||||
if not task_config.get("auto_gen"):
|
||||
return
|
||||
task_config = task.get("addition", {}).get(
|
||||
self.plugin_name, self.default_task_config
|
||||
)
|
||||
if not task_config.get("auto_gen"):
|
||||
return
|
||||
if task.get("savepath") and task.get("savepath").startswith(
|
||||
self.quark_root_dir
|
||||
):
|
||||
|
||||
@ -26,15 +26,18 @@ class Emby:
|
||||
self.is_active = True
|
||||
|
||||
def run(self, task, **kwargs):
|
||||
if task_config := task.get("addition", {}).get(self.plugin_name, {}):
|
||||
if media_id := task_config.get("media_id"):
|
||||
if media_id != "0":
|
||||
self.refresh(media_id)
|
||||
elif task_config.get("try_match"):
|
||||
if match_media_id := self.search(task["taskname"]):
|
||||
self.refresh(match_media_id)
|
||||
task["addition"][self.plugin_name]["media_id"] = match_media_id
|
||||
return task
|
||||
task_config = task.get("addition", {}).get(
|
||||
self.plugin_name, self.default_task_config
|
||||
)
|
||||
if media_id := task_config.get("media_id"):
|
||||
if media_id != "0":
|
||||
self.refresh(media_id)
|
||||
elif task_config.get("try_match"):
|
||||
if match_media_id := self.search(task["taskname"]):
|
||||
self.refresh(match_media_id)
|
||||
task_config["media_id"] = match_media_id
|
||||
task.setdefault("addition", {})[self.plugin_name] = task_config
|
||||
return task
|
||||
|
||||
def get_info(self):
|
||||
url = f"{self.url}/emby/System/Info"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user