From abc8983a6fba37c8d083620ebacbc65e08c525da Mon Sep 17 00:00:00 2001 From: YozoraXCII <96386153+YozoraXCII@users.noreply.github.com> Date: Tue, 18 Apr 2023 20:58:22 +0100 Subject: [PATCH 1/2] add Networks Overlay to Nav --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index da1d3085..8e1e0134 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -309,6 +309,7 @@ html_theme_options = { ("Audio/Subtitle Language Flags", "defaults/overlays/languages"), ("Languages", "defaults/overlays/languages"), ("MediaStinger", "defaults/overlays/mediastinger"), + ("Networks", "defaults/overlays/network"), ("Ratings", "defaults/overlays/ratings"), ("Resolution/Edition", "defaults/overlays/resolution"), ("Ribbon", "defaults/overlays/ribbon"), From b572af04feff5816f31277fd85a37d081c816eb4 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 19 Apr 2023 17:51:05 -0400 Subject: [PATCH 2/2] [24] fix webhooks --- VERSION | 2 +- modules/webhooks.py | 63 +++++++++++++++++++++++---------------------- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/VERSION b/VERSION index 379e4df2..b4341629 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.19.0-develop23 +1.19.0-develop24 diff --git a/modules/webhooks.py b/modules/webhooks.py index 71f912b9..94b1e8b6 100644 --- a/modules/webhooks.py +++ b/modules/webhooks.py @@ -36,37 +36,38 @@ class Webhooks: elif webhook.startswith("https://hooks.slack.com/services"): json = self.slack(json) response = self.config.post(webhook, json=json) - try: - response_json = response.json() - logger.trace(f"Response: {response_json}") - if webhook == "notifiarr" and self.notifiarr and response.status_code == 400: - def remove_from_config(text, hook_cat): - if response_json["details"]["response"] == text: - yaml = YAML(self.config.config_path) - changed = False - if hook_cat in yaml.data and yaml.data["webhooks"][hook_cat]: - if isinstance(yaml.data["webhooks"][hook_cat], list) and "notifiarr" in yaml.data["webhooks"][hook_cat]: - changed = True - yaml.data["webhooks"][hook_cat].pop("notifiarr") - elif yaml.data["webhooks"][hook_cat] == "notifiarr": - changed = True - yaml.data["webhooks"][hook_cat] = None - if changed: - yaml.save() - remove_from_config("PMM updated trigger is not enabled", "changes") - remove_from_config("PMM created trigger is not enabled", "changes") - remove_from_config("PMM deleted trigger is not enabled", "changes") - remove_from_config("PMM failure trigger is not enabled", "error") - remove_from_config("PMM start/complete trigger is not enabled", "run_start") - remove_from_config("PMM start/complete trigger is not enabled", "run_end") - remove_from_config("PMM app updates trigger is not enabled", "version") - if "result" in response_json and response_json["result"] == "error" and "details" in response_json and "response" in response_json["details"]: - raise Failed(f"Notifiarr Error: {response_json['details']['response']}") - if response.status_code >= 400 or ("result" in response_json and response_json["result"] == "error"): - raise Failed(f"({response.status_code} [{response.reason}]) {response_json}") - except JSONDecodeError: - if response.status_code >= 400: - raise Failed(f"({response.status_code} [{response.reason}])") + if response is not None: + try: + response_json = response.json() + logger.trace(f"Response: {response_json}") + if webhook == "notifiarr" and self.notifiarr and response.status_code == 400: + def remove_from_config(text, hook_cat): + if response_json["details"]["response"] == text: + yaml = YAML(self.config.config_path) + changed = False + if hook_cat in yaml.data and yaml.data["webhooks"][hook_cat]: + if isinstance(yaml.data["webhooks"][hook_cat], list) and "notifiarr" in yaml.data["webhooks"][hook_cat]: + changed = True + yaml.data["webhooks"][hook_cat].pop("notifiarr") + elif yaml.data["webhooks"][hook_cat] == "notifiarr": + changed = True + yaml.data["webhooks"][hook_cat] = None + if changed: + yaml.save() + remove_from_config("PMM updated trigger is not enabled", "changes") + remove_from_config("PMM created trigger is not enabled", "changes") + remove_from_config("PMM deleted trigger is not enabled", "changes") + remove_from_config("PMM failure trigger is not enabled", "error") + remove_from_config("PMM start/complete trigger is not enabled", "run_start") + remove_from_config("PMM start/complete trigger is not enabled", "run_end") + remove_from_config("PMM app updates trigger is not enabled", "version") + if "result" in response_json and response_json["result"] == "error" and "details" in response_json and "response" in response_json["details"]: + raise Failed(f"Notifiarr Error: {response_json['details']['response']}") + if response.status_code >= 400 or ("result" in response_json and response_json["result"] == "error"): + raise Failed(f"({response.status_code} [{response.reason}]) {response_json}") + except JSONDecodeError: + if response.status_code >= 400: + raise Failed(f"({response.status_code} [{response.reason}])") def start_time_hooks(self, start_time): if self.run_start_webhooks: