From 278d23f3b9e7380055ed0ddf8c03e5bfa83878e4 Mon Sep 17 00:00:00 2001 From: Bluefissure Date: Tue, 14 Mar 2023 18:35:58 +0000 Subject: [PATCH 1/2] chore: unnecessary lambda --- src/module/conf/const.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/module/conf/const.py b/src/module/conf/const.py index 0a8fae7e..d81a6bd7 100644 --- a/src/module/conf/const.py +++ b/src/module/conf/const.py @@ -55,9 +55,9 @@ DEFAULT_SETTINGS = { ENV_TO_ATTR = { "program": { - "AB_INTERVAL_TIME": ("sleep_time", lambda e: float(e)), - "AB_RENAME_FREQ": ("times", lambda e: float(e)), - "AB_WEBUI_PORT": ("webui_port", lambda e: int(e)), + "AB_INTERVAL_TIME": ("sleep_time", float), + "AB_RENAME_FREQ": ("times", float), + "AB_WEBUI_PORT": ("webui_port", int), }, "downloader": { "AB_DOWNLOADER_HOST": "host", From b9019e2265b7ca46dfc751feb7515a4d6e1c403a Mon Sep 17 00:00:00 2001 From: Bluefissure Date: Tue, 14 Mar 2023 18:36:59 +0000 Subject: [PATCH 2/2] fix: settings has no download_path anymore --- src/module/manager/eps_complete.py | 2 +- src/module/manager/repath.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module/manager/eps_complete.py b/src/module/manager/eps_complete.py index ee404629..a12cb8b7 100644 --- a/src/module/manager/eps_complete.py +++ b/src/module/manager/eps_complete.py @@ -35,7 +35,7 @@ class FullSeasonGet: download_info = { "url": torrent.torrent_link, "save_path": os.path.join( - settings.download_path, + settings.downloader.path, data["official_title"], f"Season {data['season']}") } diff --git a/src/module/manager/repath.py b/src/module/manager/repath.py index 48bc6b7b..99e32cd3 100644 --- a/src/module/manager/repath.py +++ b/src/module/manager/repath.py @@ -45,7 +45,7 @@ class RePath: path = rules.get(rule).savePath must_contain = rules.get(rule).mustContain season, folder_name = self.analyse_path(path) - new_path = PurePath(settings.download_path, folder_name, f"Season {season}").__str__() + new_path = PurePath(settings.downloader.path, folder_name, f"Season {season}").__str__() all_rule.append(RuleInfo(rule, must_contain, season, folder_name, new_path)) return all_rule