From 02e6e419b493d02eecfad2a72a0e89f35cb801a8 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Mon, 9 Jan 2023 21:11:11 -0500 Subject: [PATCH 1/6] [13] fix flixpatrol time_range --- VERSION | 2 +- modules/operations.py | 7 +++++-- modules/util.py | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 19d8f8c9..897cf508 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.2-develop12 +1.18.2-develop13 diff --git a/modules/operations.py b/modules/operations.py index 5b2212ff..c5543267 100644 --- a/modules/operations.py +++ b/modules/operations.py @@ -185,8 +185,11 @@ class Operations: if any([o.startswith("mal") for o in self.library.meta_operations]): if item.ratingKey in reverse_mal: mal_id = reverse_mal[item.ratingKey] - elif not anidb_id or anidb_id not in self.config.Convert._anidb_to_mal: - logger.warning(f"No AniDB ID to Convert to MyAnimeList ID for Guid: {item.guid}") + elif not anidb_id: + logger.warning(f"Covert Warning: No AniDB ID to Convert to MyAnimeList ID for Guid: {item.guid}") + mal_id = None + elif anidb_id not in self.config.Convert._anidb_to_mal: + logger.warning(f"Covert Warning: No MyAnimeList Found for AniDB ID: {anidb_id} of Guid: {item.guid}") mal_id = None else: mal_id = self.config.Convert._anidb_to_mal[anidb_id] diff --git a/modules/util.py b/modules/util.py index ff69d5e5..47339a1d 100644 --- a/modules/util.py +++ b/modules/util.py @@ -404,8 +404,10 @@ def time_window(tw): return f"{today - timedelta(weeks=1):%Y-0%V}" elif tw == "this_month": return f"{today:%Y-%m}" + elif tw == "last_month" and today.month == 1: + return f"{today.year - 1}-12" elif tw == "last_month": - return f"{today.year}-{today.month - 1 or 12}" + return f"{today.year}-{today.month - 1:02}" elif tw == "this_year": return f"{today.year}" elif tw == "last_year": From 4d09a6a0c0c968291c67344f9c622d2a69962aae Mon Sep 17 00:00:00 2001 From: Chaz Larson Date: Wed, 11 Jan 2023 08:54:31 -0600 Subject: [PATCH 2/6] expanded example --- docs/config/radarr.md | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/docs/config/radarr.md b/docs/config/radarr.md index b3868c5b..6ce3c2f5 100644 --- a/docs/config/radarr.md +++ b/docs/config/radarr.md @@ -8,6 +8,8 @@ Items in your List Exclusions will be ignored by PMM. A `radarr` mapping can be either in the root of the config file as global mapping for all libraries, or you can specify the `radarr` mapping individually per library. +At the library level, only those settings which are different to the default need to be specified; there is an example of this at the end of the page. + Below is a `radarr` mapping example and the full set of attributes: ```yaml radarr: @@ -52,34 +54,48 @@ radarr: # Other examples: -Specifying a second Radarr instance for a specific library: +Specifying different options for specific libraries: -In this example we have two Radarr instances, standard and 4K. We want to add 4K movies to the 4K Radarr instance with a different root folder and availability. +In this example we have two Radarr instances, standard and 4K, and four libraries showing how one can override individual settings at the library level. -```yaml +``` libraries: - Movies: + Library01: # this library uses the default radarr config + metadata_path: + - file: config/Movies.yml + + Library02: # this library overrides radarr root path and profile metadata_path: - file: config/Movies.yml - Movies - 4K: + radarr: + root_folder_path: /data/media/movies/tony + quality_profile: Better + + Library03: # this library overrides radarr quality profile + metadata_path: + - file: config/Movies.yml + radarr: + quality_profile: Best + + Library04: # this library uses the 4K radarr instance metadata_path: - file: config/Movies.yml radarr: - url: https://radarr-4K.bing.bang - token: SOME_TOKEN - root_folder_path: /movies-4K - availability: cinemas + url: https://radarr-4k.bing.bang + token: SOME_OTHER_TOKEN + root_folder_path: /data/media/movies/geezer + quality_profile: Bestest ... radarr: url: https://radarr.bing.bang token: SOME_TOKEN + quality_profile: Good add_missing: true add_existing: false upgrade_existing: false root_folder_path: /movies monitor: movie availability: released - quality_profile: Any tag: search: false radarr_path: From a2b22e8a6ddb1eba1454718b9ffb5662288ff036 Mon Sep 17 00:00:00 2001 From: Chaz Larson Date: Wed, 11 Jan 2023 09:01:19 -0600 Subject: [PATCH 3/6] expanded example --- docs/config/sonarr.md | 53 ++++++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/docs/config/sonarr.md b/docs/config/sonarr.md index a99553f1..b5aec798 100644 --- a/docs/config/sonarr.md +++ b/docs/config/sonarr.md @@ -8,6 +8,9 @@ Items in your List Exclusions will be ignored by PMM. A `sonarr` mapping can be either in the root of the config file as global mapping for all libraries, or you can specify the `sonarr` mapping individually per library. +At the library level, only those settings which are different to the global settings need to be specified; there is an example of this at the end of the page. + + Below is a `sonarr` mapping example and the full set of attributes: ```YAML sonarr: @@ -59,24 +62,48 @@ sonarr: Specifying a second Sonarr instance for a specific library: -In this example we have two Sonarr instances, standard and 4K. We want to add 4K shows to the 4K Sonarr instance with a different root folder and quality profile. Also, shows are being added to the "TV Shows - 4K" library outside Sonarr via a custom script and I want those new shows added to Sonarr for tracking. +In this example we have two Sonarr instances, standard and 4K, with five libraries that override various details. Also, shows are being added to the "Library05" library outside Sonarr via a custom script and I want those new shows added to Sonarr for tracking. -```yaml +``` libraries: - TV Shows: + Library01: # this library uses the default sonarr config + metadata_path: + - file: config/TV.yml + + Library02: # this library overrides sonarr root path and profile + metadata_path: + - file: config/TV.yml + radarr: + root_folder_path: /data/media/shows/tony + quality_profile: Better + + Library03: # this library overrides sonarr quality profile metadata_path: - file: config/TV.yml - TV Shows - 4K: + radarr: + quality_profile: Best + + Library04: # this library uses the 4K sonarr instance metadata_path: - file: config/TV.yml - sonarr: - url: https://sonarr-4K.bing.bang - token: SOME_TOKEN - root_folder_path: /shows-4K - quality_profile: 4K + radarr: + url: https://sonarr-4k.bing.bang + token: SOME_OTHER_TOKEN + root_folder_path: /data/media/shows/geezer + quality_profile: Bestest + + Library05: # shows get added by a custom script so they should get added to sonarr-4k + metadata_path: + - file: config/TV.yml + radarr: + url: https://sonarr-4k.bing.bang + token: SOME_OTHER_TOKEN + root_folder_path: /data/media/shows/bill + quality_profile: Bestest add_existing: true - sonarr_path: /shows-4K - plex_path: /mnt/unionfs/Media/TV + sonarr_path: /data/media/shows/bill + plex_path: /mnt/unionfs/shows/bill + ... sonarr: url: https://sonarr.bing.bang @@ -84,9 +111,9 @@ sonarr: add_missing: false add_existing: false upgrade_existing: false - root_folder_path: /shows + root_folder_path: /data/media/shows/ozzy monitor: all - quality_profile: HD-1080p + quality_profile: Good language_profile: English series_type: standard season_folder: true From 8ca2984189e2fa9c2032082bfcc5fd4682090d90 Mon Sep 17 00:00:00 2001 From: Chaz Larson Date: Wed, 11 Jan 2023 09:02:03 -0600 Subject: [PATCH 4/6] a word --- docs/config/radarr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config/radarr.md b/docs/config/radarr.md index 6ce3c2f5..fc352ac0 100644 --- a/docs/config/radarr.md +++ b/docs/config/radarr.md @@ -8,7 +8,7 @@ Items in your List Exclusions will be ignored by PMM. A `radarr` mapping can be either in the root of the config file as global mapping for all libraries, or you can specify the `radarr` mapping individually per library. -At the library level, only those settings which are different to the default need to be specified; there is an example of this at the end of the page. +At the library level, only those settings which are different to the global settings need to be specified; there is an example of this at the end of the page. Below is a `radarr` mapping example and the full set of attributes: ```yaml From bf915f7067c086e7fb99e18d7c5b5b39fc380368 Mon Sep 17 00:00:00 2001 From: Chaz Larson Date: Wed, 11 Jan 2023 09:04:34 -0600 Subject: [PATCH 5/6] add fifth example from sonarr page --- docs/config/radarr.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/config/radarr.md b/docs/config/radarr.md index fc352ac0..046a2194 100644 --- a/docs/config/radarr.md +++ b/docs/config/radarr.md @@ -56,7 +56,8 @@ radarr: Specifying different options for specific libraries: -In this example we have two Radarr instances, standard and 4K, and four libraries showing how one can override individual settings at the library level. +In this example we have two Radarr instances, standard and 4K, and four libraries showing how one can override individual settings at the library level. Also, movies are being added to the "Library05" library outside Radarr via a custom script and I want those new movies added to Radarr for tracking. + ``` libraries: @@ -85,6 +86,18 @@ libraries: token: SOME_OTHER_TOKEN root_folder_path: /data/media/movies/geezer quality_profile: Bestest + + Library05: # movies get added by a custom script so they should get added to radarr-4k + metadata_path: + - file: config/Movies.yml + radarr: + url: https://radarr-4k.bing.bang + token: SOME_OTHER_TOKEN + root_folder_path: /data/media/movies/bill + quality_profile: Bestest + add_existing: true + sonarr_path: /data/media/movies/bill + plex_path: /mnt/unionfs/movies/bill ... radarr: url: https://radarr.bing.bang From 765863f6f70df0bb31cdc3f15d0f0048cff4d7a3 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 11 Jan 2023 13:59:58 -0500 Subject: [PATCH 6/6] [14] fix doc error --- VERSION | 2 +- docs/metadata/templates.md | 2 +- plex_meta_manager.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 897cf508..369e5aef 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.2-develop13 +1.18.2-develop14 diff --git a/docs/metadata/templates.md b/docs/metadata/templates.md index 6578c2ab..2d6b4b42 100644 --- a/docs/metadata/templates.md +++ b/docs/metadata/templates.md @@ -145,7 +145,7 @@ There are some attributes unique to `templates`; `default`, `optional`, `conditi * `optional` can specify variables that if not specified on the template call will cause any attribute using one of those variables to be ignored in the template. You can make any template variable optional per collection by setting it to `null`. * `conditionals` can specify variables based on conditions set by the user. See more [here](#conditionals) * `move_prefix` can be given a list or comma-separated string of prefixes to move to the end of the collection/playlist name for sorting. - i.e. If you have `move_prefix: The` and a collection is called `The Avengers` then `<>` is replaced with `Avengers, The` instead of `The Avengers` for that collection. + i.e. If you have `move_prefix: The` and a collection is called `The Avengers` then `<>` is replaced with `Avengers, The` instead of `The Avengers` for that collection. Every template call is given these template variables. diff --git a/plex_meta_manager.py b/plex_meta_manager.py index c5f56163..f5023aad 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -292,7 +292,7 @@ def start(attrs): logger.separator(f"{err_type.lower().capitalize()} Summary", space=False, border=False) logger.info("") - logger.info(f"Count | Message") + logger.info("Count | Message") logger.separator(f"{logger.separating_character * 5}|", space=False, border=False, side_space=False, left=True) for k, v in Counter(log_data[err_type]).most_common(): logger.info(f"{v:>5} | {k}")