Small Fixes

This commit is contained in:
meisnate12 2021-12-20 09:47:50 -05:00
parent e71f32ca61
commit 364f261b4c
2 changed files with 10 additions and 9 deletions

View file

@ -171,7 +171,7 @@ playlist_attributes = [
"playlist_name", "filters", "name_mapping", "show_filtered", "show_missing", "save_missing", "playlist_name", "filters", "name_mapping", "show_filtered", "show_missing", "save_missing",
"missing_only_released", "only_filter_missing", "delete_below_minimum", "ignore_ids", "ignore_imdb_ids", "missing_only_released", "only_filter_missing", "delete_below_minimum", "ignore_ids", "ignore_imdb_ids",
"server_preroll", "collection_changes_webhooks", "collection_minimum" "server_preroll", "collection_changes_webhooks", "collection_minimum"
] + custom_sort_builders + summary_details + poster_details + radarr_details + sonarr_details ] + custom_sort_builders + summary_details + poster_details + background_details + radarr_details + sonarr_details
class CollectionBuilder: class CollectionBuilder:
def __init__(self, config, library, metadata, name, no_missing, data, playlist=False): def __init__(self, config, library, metadata, name, no_missing, data, playlist=False):
@ -832,7 +832,7 @@ class CollectionBuilder:
raise Failed(f"{self.Type} Error: Cannot use {method_name}.remove and {method_name}.sync together") raise Failed(f"{self.Type} Error: Cannot use {method_name}.remove and {method_name}.sync together")
if method_name in methods and f"{method_name}.remove" in methods: if method_name in methods and f"{method_name}.remove" in methods:
raise Failed(f"{self.Type} Error: Cannot use {method_name} and {method_name}.remove together") raise Failed(f"{self.Type} Error: Cannot use {method_name} and {method_name}.remove together")
self.item_details[method_name] = util.get_list(method_data) self.item_details[method_name] = util.get_list(method_data, lower=True)
self.item_details["apply_tags"] = method_mod[1:] if method_mod else "" self.item_details["apply_tags"] = method_mod[1:] if method_mod else ""
elif method_name == "item_overlay": elif method_name == "item_overlay":
overlay = os.path.join(self.config.default_dir, "overlays", method_data, "overlay.png") overlay = os.path.join(self.config.default_dir, "overlays", method_data, "overlay.png")
@ -870,7 +870,7 @@ class CollectionBuilder:
elif method_name == "radarr_quality": elif method_name == "radarr_quality":
self.radarr_details["quality"] = method_data self.radarr_details["quality"] = method_data
elif method_name == "radarr_tag": elif method_name == "radarr_tag":
self.radarr_details["tag"] = util.get_list(method_data) self.radarr_details["tag"] = util.get_list(method_data, lower=True)
def _sonarr(self, method_name, method_data): def _sonarr(self, method_name, method_data):
if method_name in ["sonarr_add", "sonarr_add_existing", "sonarr_season", "sonarr_search", "sonarr_cutoff_search"]: if method_name in ["sonarr_add", "sonarr_add_existing", "sonarr_season", "sonarr_search", "sonarr_cutoff_search"]:
@ -888,7 +888,7 @@ class CollectionBuilder:
else: else:
raise Failed(f"{self.Type} Error: {method_name} attribute must be either standard, daily, or anime") raise Failed(f"{self.Type} Error: {method_name} attribute must be either standard, daily, or anime")
elif method_name == "sonarr_tag": elif method_name == "sonarr_tag":
self.sonarr_details["tag"] = util.get_list(method_data) self.sonarr_details["tag"] = util.get_list(method_data, lower=True)
def _anidb(self, method_name, method_data): def _anidb(self, method_name, method_data):
if method_name == "anidb_popular": if method_name == "anidb_popular":

View file

@ -22,11 +22,12 @@ class Webhooks:
if self.config.trace_mode: if self.config.trace_mode:
logger.debug(f"Webhook: {webhook}") logger.debug(f"Webhook: {webhook}")
if webhook == "notifiarr": if webhook == "notifiarr":
url, params = self.notifiarr.get_url("notification/pmm/") if self.notifiarr:
for x in range(6): url, params = self.notifiarr.get_url("notification/pmm/")
response = self.config.get(url, json=json, params=params) for x in range(6):
if response.status_code < 500: response = self.config.get(url, json=json, params=params)
break if response.status_code < 500:
break
else: else:
response = self.config.post(webhook, json=json) response = self.config.post(webhook, json=json)
try: try: