Merge branch 'develop' into patch-1

This commit is contained in:
buthed010203 2023-05-18 14:45:35 -04:00 committed by GitHub
commit 8448939b3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 31 deletions

View file

@ -110,27 +110,28 @@ class Config:
self.data["notifiarr"] = self.data.pop("notifiarr") self.data["notifiarr"] = self.data.pop("notifiarr")
if "webhooks" in self.data: if "webhooks" in self.data:
temp = self.data.pop("webhooks") temp = self.data.pop("webhooks")
if "function" not in temp or ("function" in temp and temp["function"] is None): if temp is not None:
temp["function"] = {} if "function" not in temp or ("function" in temp and temp["function"] is None):
temp["function"] = {}
def hooks(attr): def hooks(attr):
if attr in temp: if attr in temp:
items = temp.pop(attr) items = temp.pop(attr)
if items: if items:
temp["function"][attr] = items temp["function"][attr] = items
if attr not in temp["function"]: if attr not in temp["function"]:
temp["function"][attr] = {} temp["function"][attr] = {}
temp["function"][attr] = None temp["function"][attr] = None
hooks("cross_seed") hooks("cross_seed")
hooks("recheck") hooks("recheck")
hooks("cat_update") hooks("cat_update")
hooks("tag_update") hooks("tag_update")
hooks("rem_unregistered") hooks("rem_unregistered")
hooks("rem_orphaned") hooks("rem_orphaned")
hooks("tag_nohardlinks") hooks("tag_nohardlinks")
hooks("cleanup_dirs") hooks("cleanup_dirs")
self.data["webhooks"] = temp self.data["webhooks"] = temp
if "bhd" in self.data: if "bhd" in self.data:
self.data["bhd"] = self.data.pop("bhd") self.data["bhd"] = self.data.pop("bhd")
self.dry_run = self.commands["dry_run"] self.dry_run = self.commands["dry_run"]

View file

@ -377,16 +377,12 @@ def start():
try: try:
cfg = Config(default_dir, args) cfg = Config(default_dir, args)
qbit_manager = cfg.qbt qbit_manager = cfg.qbt
except Exception as ex: except Exception as ex:
if "Qbittorrent Error" in ex.args[0]: logger.stacktrace()
logger.print_line(ex, "CRITICAL") logger.print_line(ex, "CRITICAL")
logger.print_line("Exiting scheduled Run.", "CRITICAL") logger.print_line("Exiting scheduled Run.", "CRITICAL")
finished_run() finished_run()
return None return None
else:
logger.stacktrace()
logger.print_line(ex, "CRITICAL")
if qbit_manager: if qbit_manager:
# Set Category # Set Category

View file

@ -1,7 +1,7 @@
flake8==6.0.0 flake8==6.0.0
pre-commit==3.2.2 pre-commit==3.3.2
qbittorrent-api==2023.4.47 qbittorrent-api==2023.4.47
requests==2.28.2 requests==2.30.0
retrying==1.3.4 retrying==1.3.4
ruamel.yaml==0.17.21 ruamel.yaml==0.17.26
schedule==1.2.0 schedule==1.2.0