From 084a13027a2cf3a3d5240deced50b561c15d4266 Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Thu, 18 Apr 2024 16:26:28 -0700 Subject: [PATCH 01/21] [Update] Reduce file permissions of /config Closes #168 --- start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 39d5f69..726d2cd 100755 --- a/start.sh +++ b/start.sh @@ -53,7 +53,7 @@ fi echo "Starting daps as $(whoami) running daps with UID: $PUID and GID: $PGID" chown -R ${PUID}:${PGID} /${CONFIG_DIR} /app > /dev/null 2>&1 -chmod -R 777 /${CONFIG_DIR} > /dev/null 2>&1 +chmod -R 660 /${CONFIG_DIR} > /dev/null 2>&1 # Run main.py as the dockeruser exec su -s /bin/bash -c "python3 /app/main.py" dockeruser \ No newline at end of file From 7be3393c7147e363fd9667ce295be837711957e0 Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Fri, 19 Apr 2024 05:28:19 -0700 Subject: [PATCH 02/21] [update] revert changes --- start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 726d2cd..39d5f69 100755 --- a/start.sh +++ b/start.sh @@ -53,7 +53,7 @@ fi echo "Starting daps as $(whoami) running daps with UID: $PUID and GID: $PGID" chown -R ${PUID}:${PGID} /${CONFIG_DIR} /app > /dev/null 2>&1 -chmod -R 660 /${CONFIG_DIR} > /dev/null 2>&1 +chmod -R 777 /${CONFIG_DIR} > /dev/null 2>&1 # Run main.py as the dockeruser exec su -s /bin/bash -c "python3 /app/main.py" dockeruser \ No newline at end of file From 09b7bb39b2204f618bb149789288cfe4076434e9 Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Fri, 19 Apr 2024 06:13:09 -0700 Subject: [PATCH 03/21] [Update] Fix-to-the-fix --- start.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/start.sh b/start.sh index 39d5f69..9b7a79c 100755 --- a/start.sh +++ b/start.sh @@ -54,6 +54,7 @@ echo "Starting daps as $(whoami) running daps with UID: $PUID and GID: $PGID" chown -R ${PUID}:${PGID} /${CONFIG_DIR} /app > /dev/null 2>&1 chmod -R 777 /${CONFIG_DIR} > /dev/null 2>&1 +chmod 660 /${CONFIG_DIR}/config.yml > /dev/null 2>&1 # Run main.py as the dockeruser exec su -s /bin/bash -c "python3 /app/main.py" dockeruser \ No newline at end of file From 373113707067b5d9ff3cab237001496121a26093 Mon Sep 17 00:00:00 2001 From: Alex Herbig Date: Fri, 3 May 2024 18:56:45 -0400 Subject: [PATCH 04/21] feat: allow ignore tags for upgradinatorr --- config/config.sample.yml | 7 ++++++- modules/upgradinatorr.py | 34 +++++++++++++++++++++------------- util/config.py | 16 ++++++---------- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/config/config.sample.yml b/config/config.sample.yml index c35774d..be12e7a 100755 --- a/config/config.sample.yml +++ b/config/config.sample.yml @@ -53,7 +53,7 @@ instances: api: abcdefghijklmnopqrstuvwxyz1234567890 sonarr: # Instance name can be whatever you want, it just needs to match the name used in other sections - sonarr_1: + sonarr_1: url: http://localhost:8989 api: abcdefghijklmnopqrstuvwxyz1234567890 sonarr_anime: @@ -328,22 +328,27 @@ upgradinatorr: radarr_1: count: 3 tag_name: checked + ignore_tag: ignore unattended: true radarr_2: count: 10 tag_name: checked + ignore_tag: ignore unattended: true sonarr_1: count: 1 tag_name: checked + ignore_tag: ignore unattended: true sonarr_anime: count: 1 tag_name: checked + ignore_tag: ignore unattended: true sonarr_3: count: 20 tag_name: checked + ignore_tag: ignore unattended: true renameinatorr: diff --git a/modules/upgradinatorr.py b/modules/upgradinatorr.py index 6f912b0..1ed25d8 100755 --- a/modules/upgradinatorr.py +++ b/modules/upgradinatorr.py @@ -25,13 +25,18 @@ script_name = "upgradinatorr" -def filter_media(media_dict, tag_id, count, logger): +def filter_media(media_dict, checked_tag_id, ignore_tag_id, count, logger): """ - Filter media_dict to remove items that are not monitored, have the tag_id, or are not in the correct status. + Filter media_dict to remove items that are: + * not monitored + * have the checked_tag_id + * have the ignore_tag_id + * not in the correct status Args: media_dict (list): A list of dictionaries containing media information. - tag_id (int): The tag_id to filter out. + checked_tag_id (int): The checked_tag_id to filter out. + ignore_tag_id (int): The ignore_tag_id to filter out. count (int): The number of items to return. Returns: @@ -43,8 +48,8 @@ def filter_media(media_dict, tag_id, count, logger): for item in media_dict: if filter_count == count: # Check if the desired count has been reached break - # Check conditions: tag_id not in tags, monitored is True, and status is one of the specified statuses - if tag_id in item['tags'] or item['monitored'] == False or item['status'] not in ["continuing", "airing", "ended", "canceled", "released"]: + # Check conditions: checked_tag_id not in tags, ignore_tag_id not in tags, monitored is True, and status is one of the specified statuses + if checked_tag_id in item['tags'] or ignore_tag_id in item['tags'] or item['monitored'] == False or item['status'] not in ["continuing", "airing", "ended", "canceled", "released"]: # Log skipped items logger.debug(f"Skipping {item['title']} ({item['year']}), Status: {item['status']}, Monitored: {item['monitored']}, Tags: {item['tags']}") continue # Move to the next item if conditions are not met @@ -107,7 +112,8 @@ def process_instance(instance_type, instance_settings, app, logger): total_count = 0 server_name = app.get_instance_name() count = instance_settings.get('count', 2) - tag_name = instance_settings.get('tag_name', "checked") + checked_tag_name = instance_settings.get('tag_name', "checked") + ignore_tag_name = instance_settings.get('ignore_tag', "ignore") unattended = instance_settings.get('unattended', False) # Logging instance settings @@ -116,7 +122,8 @@ def process_instance(instance_type, instance_settings, app, logger): ] logger.debug(create_table(table)) logger.debug(f'{"Count:":<20}{count}') - logger.debug(f'{"tag_name:":<20}{tag_name}') + logger.debug(f'{"checked_tag_name:":<20}{checked_tag_name}') + logger.debug(f'{"ignore_tag_name:":<20}{checked_tag_name}') logger.debug(f'{"unattended:":<20}{unattended}') logger.debug('*' * 40) @@ -127,16 +134,17 @@ def process_instance(instance_type, instance_settings, app, logger): logger.debug(f"media_dict:\n{json.dumps(media_dict, indent=4)}") # Get tag ID based on the provided tag name - tag_id = app.get_tag_id_from_name(tag_name) + checked_tag_id = app.get_tag_id_from_name(checked_tag_name) + ignore_tag_id = app.get_tag_id_from_name(ignore_tag_name) # Filter media based on tag and count criteria - filtered_media_dict = filter_media(media_dict, tag_id, count, logger) + filtered_media_dict = filter_media(media_dict, checked_tag_id, ignore_tag_id, count, logger) if not filtered_media_dict and unattended: media_ids = [item['media_id'] for item in media_dict] logger.info("All media is tagged. Removing tags...") - app.remove_tags(media_ids, tag_id) + app.remove_tags(media_ids, checked_tag_id) media_dict = handle_starr_data(app, server_name, instance_type, include_episode=False) - filtered_media_dict = filter_media(media_dict, tag_id, count, logger) + filtered_media_dict = filter_media(media_dict, checked_tag_id, ignore_tag_id, count, logger) # If no filtered_media and not unattended return if not filtered_media_dict and not unattended: @@ -149,7 +157,7 @@ def process_instance(instance_type, instance_settings, app, logger): if media_dict: total_count = len(media_dict) for item in media_dict: - if tag_id in item['tags']: + if checked_tag_id in item['tags']: tagged_count += 1 else: untagged_count += 1 @@ -167,7 +175,7 @@ def process_instance(instance_type, instance_settings, app, logger): if not dry_run: media_ids = [item['media_id'] for item in filtered_media_dict] search_response = app.search_media(media_ids) - app.add_tags(media_ids, tag_id) + app.add_tags(media_ids, checked_tag_id) ready = app.wait_for_command(search_response['id']) if ready: sleep_time = 10 # Set the sleep time to 5 seconds diff --git a/util/config.py b/util/config.py index a7dfb04..9c59c1e 100755 --- a/util/config.py +++ b/util/config.py @@ -46,18 +46,14 @@ def load_config(self): """ # Open the YAML config file and load its contents try: - try: - with open(self.config_path, "r") as file: - config = yaml.safe_load(file) - except FileNotFoundError: - print(f"Config file not found at {self.config_path}") - return - except yaml.parser.ParserError as e: - print(f"Error parsing config file: {e}") - return + with open(self.config_path, "r") as file: + config = yaml.safe_load(file) except FileNotFoundError: print(f"Config file not found at {self.config_path}") return + except yaml.parser.ParserError as e: + print(f"Error parsing config file: {e}") + return # Set various attributes from the loaded config self.instances_config = config['instances'] # Instance configurations @@ -81,4 +77,4 @@ def load_config(self): self.sonarr_config = self.instances_config.get('sonarr', {}) # Sonarr configurations self.qbit_config = self.instances_config.get('qbittorrent', {}) # qBittorrent configurations self.plex_config = self.instances_config.get('plex', {}) # Plex configurations - \ No newline at end of file + From f529bac07f23af1c30322481d48d986589d6e9ca Mon Sep 17 00:00:00 2001 From: Feramance Date: Mon, 27 May 2024 21:08:50 +0200 Subject: [PATCH 05/21] Fix: Better handling of paths to correctly manage windows paths from Arr --- modules/poster_renamerr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/poster_renamerr.py b/modules/poster_renamerr.py index 45ba7bb..3c6fca9 100755 --- a/modules/poster_renamerr.py +++ b/modules/poster_renamerr.py @@ -272,7 +272,7 @@ def rename_files(matched_assets, script_config, logger): messages = [] discord_messages = [] files = item['files'] - folder = item['folder'] + folder = os.path.basename(os.path.normpath(item['folder'])) # Remove any OS illegal characters from the file name if asset_type == "collections": From 3a2d6553aa4003d2aadd7ded0e8af4ed9a8fab04 Mon Sep 17 00:00:00 2001 From: Feramance Date: Mon, 27 May 2024 22:44:29 +0200 Subject: [PATCH 06/21] Properly fixed --- modules/poster_renamerr.py | 2 +- util/utility.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/poster_renamerr.py b/modules/poster_renamerr.py index 3c6fca9..45ba7bb 100755 --- a/modules/poster_renamerr.py +++ b/modules/poster_renamerr.py @@ -272,7 +272,7 @@ def rename_files(matched_assets, script_config, logger): messages = [] discord_messages = [] files = item['files'] - folder = os.path.basename(os.path.normpath(item['folder'])) + folder = item['folder'] # Remove any OS illegal characters from the file name if asset_type == "collections": diff --git a/util/utility.py b/util/utility.py index e0dd77b..9b677eb 100755 --- a/util/utility.py +++ b/util/utility.py @@ -589,6 +589,12 @@ def handle_starr_data(app, server_name, instance_type, include_episode=False): else: title = item['title'] year = item['year'] + # Check windows path + reg = re.match(r"^([A-Z]:\\)", item['path']) + if reg.group(1): + folder = item['path'][item['path'].rfind("\\")+1:] + else: + folder = os.path.basename(os.path.normpath(item['path'])) # Construct a dictionary for each item and append it to media_dict media_dict.append({ 'title': title, @@ -606,7 +612,7 @@ def handle_starr_data(app, server_name, instance_type, include_episode=False): 'alternate_titles': alternate_titles, 'normalized_alternate_titles': normalized_alternate_titles, 'file_id': file_id if instance_type == "radarr" else None, - 'folder': os.path.basename(os.path.normpath(item['path'])), + 'folder': folder, 'has_file': item['hasFile'] if instance_type == "radarr" else None, 'tags': item['tags'], 'seasons': season_list if instance_type == "sonarr" else None, # Add season_list for Sonarr items From 203b173f86a087a24019fce2b8759ed14a044599 Mon Sep 17 00:00:00 2001 From: zhdenny Date: Mon, 3 Jun 2024 21:05:16 -0400 Subject: [PATCH 07/21] fix gdrive_sync script *.partial permissions errors reported by rclone --- scripts/rclone.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/rclone.sh b/scripts/rclone.sh index 3dffe37..a324515 100755 --- a/scripts/rclone.sh +++ b/scripts/rclone.sh @@ -50,6 +50,7 @@ rclone sync \ --no-update-modtime \ --drive-use-trash=false \ --drive-chunk-size=512M \ + --exclude=**.partial \ --check-first \ --bwlimit=80M \ --size-only \ @@ -61,4 +62,4 @@ if [ "$verbose" = false ]; then echo fi -exit 0 \ No newline at end of file +exit 0 From ed01539f42aedde90e212738de516526d8bf0daa Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Wed, 12 Jun 2024 06:14:00 -0700 Subject: [PATCH 08/21] [Fix] AttributeError with windows handling of paths --- util/utility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/utility.py b/util/utility.py index 9b677eb..cc5c99a 100755 --- a/util/utility.py +++ b/util/utility.py @@ -591,7 +591,7 @@ def handle_starr_data(app, server_name, instance_type, include_episode=False): year = item['year'] # Check windows path reg = re.match(r"^([A-Z]:\\)", item['path']) - if reg.group(1): + if reg and reg.group(1): folder = item['path'][item['path'].rfind("\\")+1:] else: folder = os.path.basename(os.path.normpath(item['path'])) From 95402a0796f6ecfbd6c4dd55f08bfdef62a23661 Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Tue, 2 Jul 2024 21:23:51 -0700 Subject: [PATCH 09/21] [Update] Add ignore_tag to schema --- schemas/config-schema.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schemas/config-schema.json b/schemas/config-schema.json index 996061d..0332481 100644 --- a/schemas/config-schema.json +++ b/schemas/config-schema.json @@ -505,6 +505,10 @@ "tag_name": { "type": "string" }, + "ignore_tag": + { + "type": "string" + }, "unattended": { "type": "boolean" } From 8b90f7394501e83209cacb13251aa72e35761fd7 Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Tue, 2 Jul 2024 21:24:23 -0700 Subject: [PATCH 10/21] [Update] Better handling of seasons without statistics key Should close issue #172 --- util/utility.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/utility.py b/util/utility.py index cc5c99a..933eee3 100755 --- a/util/utility.py +++ b/util/utility.py @@ -568,10 +568,15 @@ def handle_starr_data(app, server_name, instance_type, include_episode=False): 'episode_id': episode['id'], 'has_file': episode['hasFile'], }) # Append episode data to the episode dictionary + # Check if season is complete + try: + status = season['statistics']['episodeCount'] == season['statistics']['totalEpisodeCount'] + except: + status = False season_list.append({ 'season_number': season['seasonNumber'], 'monitored': season['monitored'], - 'season_pack': season['statistics']['episodeCount'] == season['statistics']['totalEpisodeCount'], + 'season_pack': status, 'season_has_episodes': season['statistics']['episodeCount'] > 0, 'episode_data': episode_list if include_episode else [], }) # Append season data to the season dictionary From 25db30b6aa5b1f54f2ad99816867b0218f15c8cd Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Tue, 2 Jul 2024 21:32:19 -0700 Subject: [PATCH 11/21] [Update] Schema to include ignore_media --- schemas/config-schema.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schemas/config-schema.json b/schemas/config-schema.json index 0332481..525d083 100644 --- a/schemas/config-schema.json +++ b/schemas/config-schema.json @@ -464,6 +464,10 @@ "library_names": { "$ref": "#/definitions/uniqueArray" }, + "ignore_media" + { + "type":"string" + }, "ignore_collections": { "$ref": "#/definitions/uniqueArray" }, From 8a71c62fd3b2469f1cd353f626e80074dfe1109f Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Tue, 2 Jul 2024 21:32:34 -0700 Subject: [PATCH 12/21] [Update] Add ignore_media to sample --- config/config.sample.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/config.sample.yml b/config/config.sample.yml index be12e7a..5e6d901 100755 --- a/config/config.sample.yml +++ b/config/config.sample.yml @@ -314,6 +314,9 @@ poster_cleanarr: library_names: - Movies - Anime Movies + ignore_media: + - "Random Movie in assets you want to keep (1999)" + - "Random Series in assets you want to keep (1999)" ignore_collections: - "Random Collection in assets you want to keep" # If using poster_renamer with border_replacer, include the tmp folder that border_replacer uses From 0f531c6f58628e78b3a57b14296b0221a53cfc86 Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Tue, 2 Jul 2024 21:53:08 -0700 Subject: [PATCH 13/21] [Add] Add ability to ignore media Should close #176 --- modules/poster_cleanarr.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/poster_cleanarr.py b/modules/poster_cleanarr.py index d825bf0..06c0e68 100755 --- a/modules/poster_cleanarr.py +++ b/modules/poster_cleanarr.py @@ -37,7 +37,7 @@ script_name = "poster_cleanarr" -def match_assets(assets_list, media_dict): +def match_assets(assets_list, media_dict, ignore_media): """ Match assets to media. @@ -67,6 +67,11 @@ def match_assets(assets_list, media_dict): # Iterate through each media data of the same media type for media_data in media_dict: + + # if title is in ignore_media, skip + if ignore_media and f"{media_data['title']} ({media_data['year']})" in ignore_media: + matched = True + continue if is_match(asset_data, media_data): matched = True @@ -245,6 +250,7 @@ def main(config): library_names = script_config.get('library_names', []) source_dirs = script_config.get('source_dirs', []) instances = script_config.get('instances', None) + ignore_media = script_config.get('ignore_media', []) # Log script settings for debugging purposes table = [ @@ -256,6 +262,7 @@ def main(config): logger.debug(f'{"Assets paths:":<20}{source_dirs}') logger.debug(f'{"Library names:":<20}{library_names}') logger.debug(f'{"Instances:":<20}{instances}') + logger.debug(f'{"Ignore media:":<20}{ignore_media}') logger.debug(create_bar("-")) source_dirs = [source_dirs] if isinstance(source_dirs, str) else source_dirs @@ -321,7 +328,7 @@ def main(config): logger.debug(f"Media:\n{json.dumps(media_dict, indent=4)}") # Match assets with media and log the results - unmatched_dict = match_assets(assets_list, media_dict) + unmatched_dict = match_assets(assets_list, media_dict, ignore_media) if unmatched_dict: logger.debug(f"Unmatched:\n{json.dumps(unmatched_dict, indent=4)}") remove_data = remove_assets(unmatched_dict, source_dirs, logger) From 80d738f26a5547df9cb1c113cf90f430dca021f5 Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Wed, 3 Jul 2024 07:38:34 -0700 Subject: [PATCH 14/21] [Fix] Schema fix --- schemas/config-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/config-schema.json b/schemas/config-schema.json index 525d083..aec6a4e 100644 --- a/schemas/config-schema.json +++ b/schemas/config-schema.json @@ -464,7 +464,7 @@ "library_names": { "$ref": "#/definitions/uniqueArray" }, - "ignore_media" + "ignore_media": { "type":"string" }, From 76735fd533b15890eb2c8f7b3c61efe477648551 Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Wed, 3 Jul 2024 07:39:07 -0700 Subject: [PATCH 15/21] [Update] Another fix for episodes that contain no statistics Another fix for #172 --- util/utility.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/utility.py b/util/utility.py index 933eee3..1b5ddd1 100755 --- a/util/utility.py +++ b/util/utility.py @@ -573,11 +573,15 @@ def handle_starr_data(app, server_name, instance_type, include_episode=False): status = season['statistics']['episodeCount'] == season['statistics']['totalEpisodeCount'] except: status = False + try: + season_stats = season['statistics']['episodeCount'] + except: + season_stats = 0 season_list.append({ 'season_number': season['seasonNumber'], 'monitored': season['monitored'], 'season_pack': status, - 'season_has_episodes': season['statistics']['episodeCount'] > 0, + 'season_has_episodes': season_stats, 'episode_data': episode_list if include_episode else [], }) # Append season data to the season dictionary From 4785377a08f12766e951ed7468d2d0f75f4e2d65 Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Wed, 3 Jul 2024 08:12:43 -0700 Subject: [PATCH 16/21] [Fix] Issue with scheduler not respecting proper ranges Should close #179 --- util/scheduler.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/util/scheduler.py b/util/scheduler.py index 5e78472..ea9f089 100755 --- a/util/scheduler.py +++ b/util/scheduler.py @@ -56,9 +56,9 @@ def check_schedule(script_name, schedule, logger): start, end = start_end.split("-") start_month, start_day = map(int, start.split("/")) end_month, end_day = map(int, end.split("/")) - current_month, current_day = map(int, now.strftime("%m/%d").split("/")) - - if start_month <= current_month <= end_month and start_day <= current_day <= end_day: + start_date = datetime(now.year, start_month, start_day) + end_date = datetime(now.year, end_month, end_day) + if start_date <= now <= end_date: return True elif frequency == "cron": local_tz = tz.tzlocal() @@ -80,7 +80,6 @@ def check_schedule(script_name, schedule, logger): next_run_times[script_name] = next_run logger.debug(f"Next run for {script_name}: {next_run}\n") - return True else: logger.debug(f"Next run time for script {script_name}: {next_run} is in the future\n") From c0771eb2dcca0f8a3ac41f5bb26ae326c2ec8fca Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Wed, 3 Jul 2024 08:29:36 -0700 Subject: [PATCH 17/21] [Fix] convert scheduled color string to list Better solution to #159 --- modules/border_replacerr.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/border_replacerr.py b/modules/border_replacerr.py index f771b09..7141507 100755 --- a/modules/border_replacerr.py +++ b/modules/border_replacerr.py @@ -61,9 +61,10 @@ def check_holiday(data, border_colors, logger): # Iterate through each holiday and its corresponding schedule and color in the data for holiday, schedule_color in data.items(): schedule = schedule_color.get('schedule', None) - + # If schedule exists for the holiday if schedule: + # Check if the schedule matches the range pattern if re.match(pattern, schedule): @@ -71,7 +72,9 @@ def check_holiday(data, border_colors, logger): if check_schedule(script_name, schedule, logger): # Retrieve the color for the holiday from schedule_color or use default border_colors holiday_colors = schedule_color.get('color', border_colors) - + # If holiday color is string convert to list + if isinstance(holiday_colors, str): + holiday_colors = [holiday_colors] # If holiday_colors exist, log the schedule execution and colors being used if holiday_colors: table = [ From 99988753a9b5b5d390e4f394926ea1faa8148769 Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Wed, 3 Jul 2024 09:03:47 -0700 Subject: [PATCH 18/21] [Update] Removed redundant code --- modules/labelarr.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/labelarr.py b/modules/labelarr.py index 953d07a..7ab79f3 100755 --- a/modules/labelarr.py +++ b/modules/labelarr.py @@ -97,8 +97,6 @@ def sync_to_plex(plex, data_dict, instance_type, logger): None """ - logger.info(f"Syncing labels to Plex") - # Loop through each item in the data_dict for item in data_dict: if instance_type == "sonarr": From 457dc5fb56f1025de38e03f8d5f5e37bd1c8edbf Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Wed, 3 Jul 2024 20:56:43 -0700 Subject: [PATCH 19/21] [Update] Additional examples for ignore_media --- config/config.sample.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/config.sample.yml b/config/config.sample.yml index 5e6d901..4ac0c27 100755 --- a/config/config.sample.yml +++ b/config/config.sample.yml @@ -317,6 +317,10 @@ poster_cleanarr: ignore_media: - "Random Movie in assets you want to keep (1999)" - "Random Series in assets you want to keep (1999)" + - "The Matrix (1999)" + - "The Lion King (1994)" + - "Friends (1994)" + - "The Simpsons (1989)" ignore_collections: - "Random Collection in assets you want to keep" # If using poster_renamer with border_replacer, include the tmp folder that border_replacer uses From 600d7d5e614838b1cd3036e840bda57436934b3d Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Wed, 3 Jul 2024 20:57:47 -0700 Subject: [PATCH 20/21] [Fix] Ignore media behavior --- modules/poster_cleanarr.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/poster_cleanarr.py b/modules/poster_cleanarr.py index 06c0e68..64e97a3 100755 --- a/modules/poster_cleanarr.py +++ b/modules/poster_cleanarr.py @@ -67,11 +67,6 @@ def match_assets(assets_list, media_dict, ignore_media): # Iterate through each media data of the same media type for media_data in media_dict: - - # if title is in ignore_media, skip - if ignore_media and f"{media_data['title']} ({media_data['year']})" in ignore_media: - matched = True - continue if is_match(asset_data, media_data): matched = True @@ -104,6 +99,9 @@ def match_assets(assets_list, media_dict, ignore_media): break # If no match is found, add the asset to unmatched assets based on media type if not matched: + if f"{asset_data['title']} ({asset_data['year']})" in ignore_media: + print(f"{asset_data['title']} ({asset_data['year']}) is in ignore_media, skipping...") + continue unmatched_assets.append({ 'title': asset_data['title'], 'year': asset_data['year'], From ad655f411343c10b68051559fab785026f6672be Mon Sep 17 00:00:00 2001 From: Drazzilb Date: Fri, 5 Jul 2024 08:18:09 -0700 Subject: [PATCH 21/21] Version 1.2.2 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index cb174d5..d2d61a7 100755 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.1 \ No newline at end of file +1.2.2 \ No newline at end of file