From 9283cbd313a6dbebdd94838cf6e3b0e835770197 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Mon, 6 Feb 2023 15:34:40 -0500 Subject: [PATCH 1/5] [59] fix reapply overlays --- VERSION | 2 +- modules/library.py | 8 +++----- modules/meta.py | 8 +++++--- modules/overlays.py | 2 +- modules/plex.py | 2 +- modules/trakt.py | 22 ++++++++++++---------- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/VERSION b/VERSION index 085d464d..7ebaf2df 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.3-develop58 +1.18.3-develop59 diff --git a/modules/library.py b/modules/library.py index 340be284..438c0c9d 100644 --- a/modules/library.py +++ b/modules/library.py @@ -167,12 +167,10 @@ class Library(ABC): if self.config.Cache: _, image_compare, _ = self.config.Cache.query_image_map(item.ratingKey, self.image_table_name) if not image_compare or str(poster.compare) != str(image_compare): - if hasattr(item, "labels"): - test = [la.tag for la in self.item_labels(item)] - if overlay and "Overlay" in test: + if overlay: + self.reload(item, force=True) + if overlay and "Overlay" in [la.tag for la in self.item_labels(item)]: item.removeLabel("Overlay") - if isinstance(item._edits, dict): - item.saveEdits() self._upload_image(item, poster) poster_uploaded = True logger.info(f"Detail: {poster.attribute} updated {poster.message}") diff --git a/modules/meta.py b/modules/meta.py index a07985af..ea9ab470 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -1210,7 +1210,7 @@ class MetadataFile(DataFile): nonlocal updated if updated: try: - current_item.saveEdits() + #current_item.saveEdits() logger.info(f"{description} Details Update Successful") except BadRequest: logger.error(f"{description} Details Update Failed") @@ -1256,7 +1256,7 @@ class MetadataFile(DataFile): summary = tmdb_item.overview genres = tmdb_item.genres - item.batchEdits() + #item.batchEdits() if title: add_edit("title", item, meta, methods, value=title) add_edit("sort_title", item, meta, methods, key="titleSort") @@ -1279,7 +1279,7 @@ class MetadataFile(DataFile): if self.library.type in util.advance_tags_to_edit: advance_edits = {} - prefs = [p.id for p in item.preferences()] + prefs = None for advance_edit in util.advance_tags_to_edit[self.library.type]: if advance_edit in methods: if advance_edit in ["metadata_language", "use_original_title"] and self.library.agent not in plex.new_plex_agents: @@ -1287,6 +1287,8 @@ class MetadataFile(DataFile): elif meta[methods[advance_edit]]: ad_key, options = plex.item_advance_keys[f"item_{advance_edit}"] method_data = str(meta[methods[advance_edit]]).lower() + if prefs is None: + prefs = [p.id for p in item.preferences()] if method_data not in options: logger.error(f"Metadata Error: {meta[methods[advance_edit]]} {advance_edit} attribute invalid") elif ad_key in prefs and getattr(item, ad_key) != options[method_data]: diff --git a/modules/overlays.py b/modules/overlays.py index 587319df..55f41b27 100644 --- a/modules/overlays.py +++ b/modules/overlays.py @@ -79,7 +79,7 @@ class Overlays: poster = None if self.config.Cache: image, image_compare, overlay_compare = self.config.Cache.query_image_map(item.ratingKey, f"{self.library.image_table_name}_overlays") - self.library.reload(item) + self.library.reload(item, force=True) overlay_compare = [] if overlay_compare is None else util.get_list(overlay_compare, split="|") has_overlay = any([item_tag.tag.lower() == "overlay" for item_tag in self.library.item_labels(item)]) diff --git a/modules/plex.py b/modules/plex.py index a23aa0d2..8a20d125 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -611,7 +611,7 @@ class Plex(Library): return self.config.TMDb.get_episode(tmdb_id, item.seasonNumber, item.episodeNumber).still_url def item_posters(self, item, providers=None): - if not providers: + if providers is None: providers = ["plex", "tmdb"] image_url = None for provider in providers: diff --git a/modules/trakt.py b/modules/trakt.py index 72a1eed5..9eb81639 100644 --- a/modules/trakt.py +++ b/modules/trakt.py @@ -254,7 +254,7 @@ class Trakt: except Failed: raise Failed(f"Trakt Error: List {data} not found") - def _parse(self, items, typeless=False, item_type=None, trakt_ids=False): + def _parse(self, items, typeless=False, item_type=None, trakt_ids=False, ignore_other=False): ids = [] for item in items: if typeless: @@ -268,6 +268,8 @@ class Trakt: current_type = item["type"] else: continue + if current_type in ["person", "list"] and ignore_other: + continue id_type, id_display = id_types[current_type] if id_type in data["ids"] and data["ids"][id_type]: final_id = data["ids"][id_type] @@ -373,7 +375,7 @@ class Trakt: def build_user_url(self, user, name): return f"{base_url.replace('api.', '')}/users/{user}/lists/{name}" - def _list(self, data, urlparse=True, trakt_ids=False, fail=True): + def _list(self, data, urlparse=True, trakt_ids=False, fail=True, ignore_other=False): try: url = requests.utils.urlparse(data).path if urlparse else f"/users/me/lists/{data}" items = self._request(f"{url}/items") @@ -384,9 +386,9 @@ class Trakt: raise Failed(f"Trakt Error: List {data} is empty") else: return [] - return self._parse(items, trakt_ids=trakt_ids) + return self._parse(items, trakt_ids=trakt_ids, ignore_other=ignore_other) - def _userlist(self, list_type, user, is_movie, sort_by=None): + def _userlist(self, list_type, user, is_movie, sort_by=None, ignore_other=False): try: url_end = "movies" if is_movie else "shows" if sort_by: @@ -396,7 +398,7 @@ class Trakt: raise Failed(f"Trakt Error: User {user} not found") if len(items) == 0: raise Failed(f"Trakt Error: {user}'s {list_type.capitalize()} is empty") - return self._parse(items, item_type="movie" if is_movie else "show") + return self._parse(items, item_type="movie" if is_movie else "show", ignore_other=ignore_other) def _recommendations(self, limit, is_movie): media_type = "Movie" if is_movie else "Show" @@ -408,10 +410,10 @@ class Trakt: raise Failed(f"Trakt Error: no {media_type} Recommendations were found") return self._parse(items, typeless=True, item_type="movie" if is_movie else "show") - def _charts(self, chart_type, is_movie, params, time_period=None): + def _charts(self, chart_type, is_movie, params, time_period=None, ignore_other=False): chart_url = f"{chart_type}/{time_period}" if time_period else chart_type items = self._request(f"/{'movies' if is_movie else 'shows'}/{chart_url}", params=params) - return self._parse(items, typeless=chart_type == "popular", item_type="movie" if is_movie else "show") + return self._parse(items, typeless=chart_type == "popular", item_type="movie" if is_movie else "show", ignore_other=ignore_other) def get_people(self, data): return {str(i[0][0]): i[0][1] for i in self._list(data) if i[1] == "tmdb_person"} @@ -491,7 +493,7 @@ class Trakt: media_type = "Movie" if is_movie else "Show" if method == "trakt_list": logger.info(f"Processing {pretty}: {data}") - return self._list(data) + return self._list(data, ignore_other=True) elif method == "trakt_recommendations": logger.info(f"Processing {pretty}: {data} {media_type}{'' if data == 1 else 's'}") return self._recommendations(data, is_movie) @@ -504,10 +506,10 @@ class Trakt: logger.info(f"{attr:>22}: {','.join(data[attr]) if isinstance(data[attr], list) else data[attr]}") values = [status_translation[v] for v in data[attr]] if attr == "status" else data[attr] params[attr] = ",".join(values) if isinstance(values, list) else values - return self._charts(data["chart"], is_movie, params, time_period=data["time_period"]) + return self._charts(data["chart"], is_movie, params, time_period=data["time_period"], ignore_other=True) elif method == "trakt_userlist": logger.info(f"Processing {pretty} {media_type}s from {data['user']}'s {data['userlist'].capitalize()}") - return self._userlist(data["userlist"], data["user"], is_movie, sort_by=data["sort_by"]) + return self._userlist(data["userlist"], data["user"], is_movie, sort_by=data["sort_by"], ignore_other=True) elif method == "trakt_boxoffice": logger.info(f"Processing {pretty}: {data} {media_type}{'' if data == 1 else 's'}") return self._charts("boxoffice", is_movie, {"limit": data}) From 93f3ded8774c6d1c3112921a2be379ce1c288660 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Mon, 6 Feb 2023 17:00:32 -0500 Subject: [PATCH 2/5] [60] catch 406 error --- VERSION | 2 +- modules/plex.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 7ebaf2df..e7603a43 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.3-develop59 +1.18.3-develop60 diff --git a/modules/plex.py b/modules/plex.py index 8a20d125..98399988 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -1139,9 +1139,17 @@ class Plex(Library): if image: logger.info(f"{text} | Reset from {location}") if poster: - self.upload_poster(item, image, url=image_url) + try: + self.upload_poster(item, image, url=image_url) + except BadRequest as e: + logger.stacktrace() + logger.error(f"Plex Error: {e}") else: - self.upload_background(item, image, url=image_url) + try: + self.upload_background(item, image, url=image_url) + except BadRequest as e: + logger.stacktrace() + logger.error(f"Plex Error: {e}") if poster and "Overlay" in [la.tag for la in self.item_labels(item)]: logger.info(self.edit_tags("label", item, remove_tags="Overlay", do_print=False)) else: From 1155eb9ca79ce1364528fd7155799ac90ad0ec23 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Mon, 6 Feb 2023 18:45:22 -0500 Subject: [PATCH 3/5] [61] fix dimensional_asset_rename --- VERSION | 2 +- modules/plex.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index e7603a43..3a015420 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.3-develop60 +1.18.3-develop61 diff --git a/modules/plex.py b/modules/plex.py index 98399988..9a1ee56a 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -1331,7 +1331,7 @@ class Plex(Library): if is_top_level and self.asset_folders and self.dimensional_asset_rename and (not poster or not background): for file in util.glob_filter(os.path.join(item_asset_directory, "*.*")): - if file.lower().endswith((".png", ".jpg", ".jpeg", "webp")) and re.match(r"s\d+e\d+|season\d+", file.lower()): + if file.lower().endswith((".png", ".jpg", ".jpeg", "webp")) and not re.match(r"s\d+e\d+|season\d+", file.lower()): try: image = Image.open(file) _w, _h = image.size From 28ba768606cbc0ac17b7a7576c004fa9ee50fac4 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Mon, 6 Feb 2023 22:20:05 -0500 Subject: [PATCH 4/5] [62] add ignore_cache option to the arrs --- VERSION | 2 +- docs/config/radarr.md | 1 + docs/config/sonarr.md | 1 + docs/metadata/details/arr.md | 2 ++ modules/builder.py | 8 ++++---- modules/config.py | 4 ++++ modules/radarr.py | 5 ++++- modules/sonarr.py | 5 ++++- 8 files changed, 21 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 3a015420..5d518999 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.3-develop61 +1.18.3-develop62 diff --git a/docs/config/radarr.md b/docs/config/radarr.md index 046a2194..ab9bffb0 100644 --- a/docs/config/radarr.md +++ b/docs/config/radarr.md @@ -35,6 +35,7 @@ radarr: | `add_missing` | Adds all missing movies found from all collections to Radarr.
Use the `radarr_add_missing` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to add missing per collection.
**boolean:** true or false | false | ❌ | | `add_existing` | Adds all existing movies in collections to Radarr.
Use the `radarr_add_existing` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to add existing per collection.
**boolean:** true or false | false | ❌ | | `upgrade_existing` | Upgrades all existing movies in collections to match the Quality Profile of the collection.
Use the `radarr_upgrade_existing` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to upgrade the Quality Profile per collection.
**boolean:** true or false | false | ❌ | +| `ignore_cache` | Ignores PMM's cache when adding items to Radarr.
Use the `radarr_ignore_cache` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to ignore per collection.
**boolean:** true or false | false | ❌ | | `root_folder_path` | Default Root Folder Path to use when adding new movies.
Use the `radarr_folder` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to set the Root Folder per collection. | N/A | ✅ | | `monitor` | Monitor the movie when adding new movies.
Use the `radarr_monitor` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to set the Monitor value per collection.
**Options:** `movie`, `collection`, `none` | true | ❌ | | `availability` | Default Minimum Availability to use when adding new movies.
Use the `radarr_availability` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to set the Availability per collection.
**Options:** `announced`, `cinemas`, `released`, `db` | `announced` | ✅ | diff --git a/docs/config/sonarr.md b/docs/config/sonarr.md index b5aec798..3d29ece9 100644 --- a/docs/config/sonarr.md +++ b/docs/config/sonarr.md @@ -38,6 +38,7 @@ sonarr: | `add_missing` | Adds all missing shows found from all collections to Sonarr.
Use the `sonarr_add_missing` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to add missing per collection.
**boolean:** true or false | false | ❌ | | `add_existing` | Adds all existing shows in collections to Sonarr.
Use the `sonarr_add_existing` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to add existing per collection.
**boolean:** true or false | false | ❌ | | `upgrade_existing` | Upgrades all existing shows in collections to match the Quality Profile of the collection.
Use the `sonarr_upgrade_existing` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to upgrade the Quality Profile per collection.
**boolean:** true or false | false | ❌ | +| `ignore_cache` | Ignores PMM's cache when adding items to Sonarr.
Use the `sonarr_ignore_cache` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to ignore per collection.
**boolean:** true or false | false | ❌ | | `root_folder_path` | Default Root Folder Path to use when adding new shows.
Use the `sonarr_folder` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to set the Root Folder per collection. | N/A | ✅ | | `monitor` | Default Monitor to use when adding new shows.
Use the `sonarr_monitor` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to set the Monitor value per collection.
**Values:**
`all`All episodes except specials
`future`Episodes that have not aired yet
`missing`Episodes that do not have files or have not aired yet
`existing`Episodes that have files or have not aired yet
`pilot`The first episode, all others will be ignored
`first`All episodes of the first season, all others will be ignored
`latest`All episodes of the latest season and future seasons
`none`No episodes
| `all` | ❌ | | `quality_profile` | Default Quality Profile to use when adding new shows.
Use the `sonarr_quality` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to set the Quality Profile per collection. | N/A | ✅ | diff --git a/docs/metadata/details/arr.md b/docs/metadata/details/arr.md index fffe7fda..706ee0ab 100644 --- a/docs/metadata/details/arr.md +++ b/docs/metadata/details/arr.md @@ -9,6 +9,7 @@ All the following attributes can override the global/library [Radarr](../../conf | `radarr_add_missing` | **Description:** Override Radarr `add_missing` attribute
**Values:** `true` or `false` | | `radarr_add_existing` | **Description:** Override Radarr `add_existing` attribute
**Values:** `true` or `false` | | `radarr_upgrade_existing` | **Description:** Override Radarr `upgrade_existing` attribute
**Values:** `true` or `false` | +| `radarr_ignore_cache` | **Description:** Override Radarr `ignore_cache` attribute
**Values:** `true` or `false` | | `radarr_folder` | **Description:** Override Radarr `root_folder_path` attribute
**Values:** Folder Path | | `radarr_monitor` | **Description:** Override Radarr `monitor` attribute
**Values:** `movie`, `collection`, or `none` | | `radarr_availability` | **Description:** Override Radarr `availability` attribute
**Values:** `announced`, `cinemas`, `released`, `db` | @@ -28,6 +29,7 @@ All the following attributes can override the global/library [Sonarr](../../conf | `sonarr_add_missing` | **Description:** Override Sonarr `add_missing` attribute
**Values:** `true` or `false` | | `sonarr_add_existing` | **Description:** Override Sonarr `add_existing` attribute
**Values:** `true` or `false` | | `sonarr_upgrade_existing` | **Description:** Override Sonarr `upgrade_existing` attribute
**Values:** `true` or `false` | +| `sonarr_ignore_cache` | **Description:** Override Sonarr `ignore_cache` attribute
**Values:** `true` or `false` | | `sonarr_folder` | **Description:** Override Sonarr `root_folder_path` attribute
**Values:** Folder Path | | `sonarr_monitor` | **Description:** Override Sonarr `monitor` attribute
**Values:** `all`, `future`, `missing`, `existing`, `pilot`, `first`, `latest`, `none` | | `sonarr_quality` | **Description:** Override Sonarr `quality_profile` attribute
**Values:** Sonarr Quality Profile | diff --git a/modules/builder.py b/modules/builder.py index 7c9e4694..5279352b 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -57,11 +57,11 @@ item_details = ["non_item_remove_label", "item_label", "item_genre", "item_editi none_details = ["label.sync", "item_label.sync", "item_genre.sync", "radarr_taglist", "sonarr_taglist", "item_edition"] radarr_details = [ "radarr_add_missing", "radarr_add_existing", "radarr_upgrade_existing", "radarr_folder", "radarr_monitor", - "radarr_search", "radarr_availability", "radarr_quality", "radarr_tag", "item_radarr_tag" + "radarr_search", "radarr_availability", "radarr_quality", "radarr_tag", "item_radarr_tag", "radarr_ignore_cache" ] sonarr_details = [ "sonarr_add_missing", "sonarr_add_existing", "sonarr_upgrade_existing", "sonarr_folder", "sonarr_monitor", "sonarr_language", - "sonarr_series", "sonarr_quality", "sonarr_season", "sonarr_search", "sonarr_cutoff_search", "sonarr_tag", "item_sonarr_tag" + "sonarr_series", "sonarr_quality", "sonarr_season", "sonarr_search", "sonarr_cutoff_search", "sonarr_tag", "item_sonarr_tag", "sonarr_ignore_cache" ] album_details = ["non_item_remove_label", "item_label", "item_album_sorting"] sub_filters = [ @@ -1069,7 +1069,7 @@ class CollectionBuilder: self.item_details[method_name] = str(method_data).lower() def _radarr(self, method_name, method_data): - if method_name in ["radarr_add_missing", "radarr_add_existing", "radarr_upgrade_existing", "radarr_search", "radarr_monitor"]: + if method_name in ["radarr_add_missing", "radarr_add_existing", "radarr_upgrade_existing", "radarr_search", "radarr_monitor", "radarr_ignore_cache"]: self.radarr_details[method_name[7:]] = util.parse(self.Type, method_name, method_data, datatype="bool") elif method_name == "radarr_folder": self.radarr_details["folder"] = method_data @@ -1088,7 +1088,7 @@ class CollectionBuilder: self.builders.append((method_name, True)) def _sonarr(self, method_name, method_data): - if method_name in ["sonarr_add_missing", "sonarr_add_existing", "sonarr_upgrade_existing", "sonarr_season", "sonarr_search", "sonarr_cutoff_search"]: + if method_name in ["sonarr_add_missing", "sonarr_add_existing", "sonarr_upgrade_existing", "sonarr_season", "sonarr_search", "sonarr_cutoff_search", "sonarr_ignore_cache"]: self.sonarr_details[method_name[7:]] = util.parse(self.Type, method_name, method_data, datatype="bool") elif method_name in ["sonarr_folder", "sonarr_quality", "sonarr_language"]: self.sonarr_details[method_name[7:]] = method_data diff --git a/modules/config.py b/modules/config.py index ed21e72d..f699b5f6 100644 --- a/modules/config.py +++ b/modules/config.py @@ -640,6 +640,7 @@ class ConfigFile: "add_missing": check_for_attribute(self.data, "add_missing", parent="radarr", var_type="bool", default=False), "add_existing": check_for_attribute(self.data, "add_existing", parent="radarr", var_type="bool", default=False), "upgrade_existing": check_for_attribute(self.data, "upgrade_existing", parent="radarr", var_type="bool", default=False), + "ignore_cache": check_for_attribute(self.data, "ignore_cache", parent="radarr", var_type="bool", default=False), "root_folder_path": check_for_attribute(self.data, "root_folder_path", parent="radarr", default_is_none=True), "monitor": check_for_attribute(self.data, "monitor", parent="radarr", var_type="bool", default=True), "availability": check_for_attribute(self.data, "availability", parent="radarr", test_list=radarr.availability_descriptions, default="announced"), @@ -655,6 +656,7 @@ class ConfigFile: "add_missing": check_for_attribute(self.data, "add_missing", parent="sonarr", var_type="bool", default=False), "add_existing": check_for_attribute(self.data, "add_existing", parent="sonarr", var_type="bool", default=False), "upgrade_existing": check_for_attribute(self.data, "upgrade_existing", parent="sonarr", var_type="bool", default=False), + "ignore_cache": check_for_attribute(self.data, "ignore_cache", parent="sonarr", var_type="bool", default=False), "root_folder_path": check_for_attribute(self.data, "root_folder_path", parent="sonarr", default_is_none=True), "monitor": check_for_attribute(self.data, "monitor", parent="sonarr", test_list=sonarr.monitor_descriptions, default="all"), "quality_profile": check_for_attribute(self.data, "quality_profile", parent="sonarr", default_is_none=True), @@ -923,6 +925,7 @@ class ConfigFile: "add_missing": check_for_attribute(lib, "add_missing", parent="radarr", var_type="bool", default=self.general["radarr"]["add_missing"], save=False), "add_existing": check_for_attribute(lib, "add_existing", parent="radarr", var_type="bool", default=self.general["radarr"]["add_existing"], save=False), "upgrade_existing": check_for_attribute(lib, "upgrade_existing", parent="radarr", var_type="bool", default=self.general["radarr"]["upgrade_existing"], save=False), + "ignore_cache": check_for_attribute(lib, "ignore_cache", parent="radarr", var_type="bool", default=self.general["radarr"]["ignore_cache"], save=False), "root_folder_path": check_for_attribute(lib, "root_folder_path", parent="radarr", default=self.general["radarr"]["root_folder_path"], req_default=True, save=False), "monitor": check_for_attribute(lib, "monitor", parent="radarr", var_type="bool", default=self.general["radarr"]["monitor"], save=False), "availability": check_for_attribute(lib, "availability", parent="radarr", test_list=radarr.availability_descriptions, default=self.general["radarr"]["availability"], save=False), @@ -951,6 +954,7 @@ class ConfigFile: "add_missing": check_for_attribute(lib, "add_missing", parent="sonarr", var_type="bool", default=self.general["sonarr"]["add_missing"], save=False), "add_existing": check_for_attribute(lib, "add_existing", parent="sonarr", var_type="bool", default=self.general["sonarr"]["add_existing"], save=False), "upgrade_existing": check_for_attribute(lib, "upgrade_existing", parent="sonarr", var_type="bool", default=self.general["sonarr"]["upgrade_existing"], save=False), + "ignore_cache": check_for_attribute(lib, "ignore_cache", parent="sonarr", var_type="bool", default=self.general["sonarr"]["ignore_cache"], save=False), "root_folder_path": check_for_attribute(lib, "root_folder_path", parent="sonarr", default=self.general["sonarr"]["root_folder_path"], req_default=True, save=False), "monitor": check_for_attribute(lib, "monitor", parent="sonarr", test_list=sonarr.monitor_descriptions, default=self.general["sonarr"]["monitor"], save=False), "quality_profile": check_for_attribute(lib, "quality_profile", parent="sonarr", default=self.general["sonarr"]["quality_profile"], req_default=True, save=False), diff --git a/modules/radarr.py b/modules/radarr.py index bae74d94..d756ff3f 100644 --- a/modules/radarr.py +++ b/modules/radarr.py @@ -38,6 +38,7 @@ class Radarr: self.search = params["search"] self.radarr_path = params["radarr_path"] if params["radarr_path"] and params["plex_path"] else "" self.plex_path = params["plex_path"] if params["radarr_path"] and params["plex_path"] else "" + self.ignore_cache = params["ignore_cache"] def add_tmdb(self, tmdb_ids, **options): _ids = [] @@ -55,6 +56,7 @@ class Radarr: logger.debug(tmdb_id) logger.trace("") upgrade_existing = options["upgrade_existing"] if "upgrade_existing" in options else self.upgrade_existing + ignore_cache = options["ignore_cache"] if "ignore_cache" in options else self.ignore_cache folder = options["folder"] if "folder" in options else self.root_folder_path monitor = options["monitor"] if "monitor" in options else self.monitor availability = availability_translation[options["availability"] if "availability" in options else self.availability] @@ -62,6 +64,7 @@ class Radarr: tags = options["tag"] if "tag" in options else self.tag search = options["search"] if "search" in options else self.search logger.trace(f"Upgrade Existing: {upgrade_existing}") + logger.trace(f"Ignore Cache: {ignore_cache}") logger.trace(f"Folder: {folder}") logger.trace(f"Monitor: {monitor}") logger.trace(f"Availability: {availability}") @@ -96,7 +99,7 @@ class Radarr: tmdb_id = item[0] if isinstance(item, tuple) else item logger.ghost(f"Loading TMDb ID {i}/{len(tmdb_ids)} ({tmdb_id})") try: - if self.config.Cache: + if self.config.Cache and not ignore_cache: _id = self.config.Cache.query_radarr_adds(tmdb_id, self.library.original_mapping_name) if _id: skipped.append(item) diff --git a/modules/sonarr.py b/modules/sonarr.py index 9840b025..2cd18b36 100644 --- a/modules/sonarr.py +++ b/modules/sonarr.py @@ -58,6 +58,7 @@ class Sonarr: self.cutoff_search = params["cutoff_search"] self.sonarr_path = params["sonarr_path"] if params["sonarr_path"] and params["plex_path"] else "" self.plex_path = params["plex_path"] if params["sonarr_path"] and params["plex_path"] else "" + self.ignore_cache = params["ignore_cache"] def add_tvdb(self, tvdb_ids, **options): _ids = [] @@ -74,6 +75,7 @@ class Sonarr: for tvdb_id in _paths: logger.debug(tvdb_id) upgrade_existing = options["upgrade_existing"] if "upgrade_existing" in options else self.upgrade_existing + ignore_cache = options["ignore_cache"] if "ignore_cache" in options else self.ignore_cache folder = options["folder"] if "folder" in options else self.root_folder_path monitor = monitor_translation[options["monitor"] if "monitor" in options else self.monitor] quality_profile = options["quality"] if "quality" in options else self.quality_profile @@ -85,6 +87,7 @@ class Sonarr: search = options["search"] if "search" in options else self.search cutoff_search = options["cutoff_search"] if "cutoff_search" in options else self.cutoff_search logger.trace(f"Upgrade Existing: {upgrade_existing}") + logger.trace(f"Ignore Cache: {ignore_cache}") logger.trace(f"Folder: {folder}") logger.trace(f"Monitor: {monitor}") logger.trace(f"Quality Profile: {quality_profile}") @@ -120,7 +123,7 @@ class Sonarr: tvdb_id = item[0] if isinstance(item, tuple) else item logger.ghost(f"Loading TVDb ID {i}/{len(tvdb_ids)} ({tvdb_id})") try: - if self.config.Cache: + if self.config.Cache and not ignore_cache: _id = self.config.Cache.query_sonarr_adds(tvdb_id, self.library.original_mapping_name) if _id: skipped.append(item) From 80a2a4809a1c6ce96957a34d51f0881f2825f523 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Tue, 7 Feb 2023 11:50:18 -0500 Subject: [PATCH 5/5] [63] add tmdb_person_offset --- VERSION | 2 +- defaults/both/actor.yml | 5 +++-- defaults/movie/director.yml | 6 ++++-- defaults/movie/producer.yml | 5 +++-- defaults/movie/writer.yml | 6 ++++-- defaults/templates.yml | 19 +++++++++++++++++-- docs/defaults/both/actor.md | 23 +++++------------------ docs/defaults/movie/director.md | 22 +++++----------------- docs/defaults/movie/producer.md | 22 +++++----------------- docs/defaults/movie/writer.md | 22 +++++----------------- docs/defaults/people.md | 23 +++++++++++++++++++++++ docs/metadata/details/metadata.md | 1 + modules/builder.py | 15 +++++++++++---- modules/meta.py | 10 +++++++++- 14 files changed, 96 insertions(+), 85 deletions(-) create mode 100644 docs/defaults/people.md diff --git a/VERSION b/VERSION index 5d518999..dfa58a47 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.3-develop62 +1.18.3-develop63 diff --git a/defaults/both/actor.yml b/defaults/both/actor.yml index 3515feb6..1898000d 100644 --- a/defaults/both/actor.yml +++ b/defaults/both/actor.yml @@ -30,12 +30,15 @@ dynamic_collections: limit: 25 title_format: <> template: + - tmdb_person - smart_filter - translation - shared template_variables: tmdb_person: default: <> + tmdb_person_offset: + default: 0 search_term: default: actor search_value: @@ -44,5 +47,3 @@ dynamic_collections: default: actor style: default: bw - url_poster: - default: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager-People-<