diff --git a/CHANGELOG b/CHANGELOG index 4e033e5e..3f8e01ae 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,8 @@ Added the `character` search option to the `imdb_search` builder Added ability to use Show-level ratings at the season and episode level for Overlays if the original source does not provide ratings at the season or episode level. This is accomplished using (Special Text Variables)[https://kometa.wiki/en/latest/files/overlays/#special-text-variables] but is not yet available for the `Ratings` Defaults file. Add `show_unfiltered` setting to display items which make it through a filter Allow `sync_to_trakt_list` on episode-level collections +When using `mass_poster_update`, added `ignore_locked` and `ignore_overlays` attributes which will prevent Kometa from resetting the image if the poster field is locked (i.e. a previous mass poster update) or if the item has an Overlay. This can effectively act as a differential update system. +When using `mass_background_update`, added `ignore_locked` attribute which will prevent Kometa from resetting the image if the poster field is locked (i.e. a previous mass poster update). This can effectively act as a differential update system. # Docs Added "getting started" page diff --git a/VERSION b/VERSION index a60f8690..d67cdf97 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0-build32 +2.1.0-build33 diff --git a/docs/config/operations.md b/docs/config/operations.md index 685ce4e5..585a8ca2 100644 --- a/docs/config/operations.md +++ b/docs/config/operations.md @@ -495,10 +495,15 @@ You can create individual blocks of operations by using a list under `operations - - + + + +
`source`Source of the poster update`tmdb`, `plex`, `lock`, or `unlock`
`seasons`Update season posters while updating shows **Default:** `true``true` (default) or `false`
`episodes`Update episode posters while updating shows **Default:** `true``true` (default) or `false`
`seasons`Update season posters while updating shows **Default:** `true``true` or `false`
`episodes`Update episode posters while updating shows **Default:** `true``true` or `false`
`ignore_locked`Skip updating image if the poster field is locked1.
**Default:** `false`
`true` or `false`
`ignore_overlays`Skip updating image if the current image has an Overlay2.
**Default:** `false`
`true` or `false`
- + + 1. The poster field will be locked if a previous `mass_poster_update` was run or if an Overlay has been applied. + 2. Kometa checks for the `Overlay` label on the item in Plex to determine if an Overlay is applied. + ???+ example "Example" ```yaml @@ -531,10 +536,13 @@ You can create individual blocks of operations by using a list under `operations - - + + +
`source`Source of the poster update`tmdb`, `plex`, `lock`, or `unlock`
`seasons`Update season posters while updating shows **Default:** `true``true` (default) or `false`
`episodes`Update episode posters while updating shows **Default:** `true``true` (default) or `false`
`seasons`Update season posters while updating shows **Default:** `true``true` or `false`
`episodes`Update episode posters while updating shows **Default:** `true``true` or `false`
`ignore_locked`Skip updating image if the poster field is locked.1 **Default:** `false``true` or `false`
+ 1. The background field will be locked if a previous `mass_background_update` was run. + ???+ example "Example" ```yaml diff --git a/modules/config.py b/modules/config.py index a77cecb3..4c958e97 100644 --- a/modules/config.py +++ b/modules/config.py @@ -941,6 +941,8 @@ class ConfigFile: "source": check_for_attribute(input_dict, "source", test_list=mass_image_options, default_is_none=True, save=False), "seasons": check_for_attribute(input_dict, "seasons", var_type="bool", default=True, save=False), "episodes": check_for_attribute(input_dict, "episodes", var_type="bool", default=True, save=False), + "ignore_locked": check_for_attribute(input_dict, "ignore_locked", var_type="bool", default=False, save=False), + "ignore_overlays": check_for_attribute(input_dict, "ignore_overlays", var_type="bool", default=False, save=False) } elif op == "metadata_backup": default_path = os.path.join(default_dir, f"{str(library_name)}_Metadata_Backup.yml") diff --git a/modules/operations.py b/modules/operations.py index b88fc150..b980f660 100644 --- a/modules/operations.py +++ b/modules/operations.py @@ -755,18 +755,44 @@ class Operations: try: new_poster, new_background, item_dir, name = self.library.find_item_assets(item) except Failed: - item_dir = None - name = None - new_poster = None - new_background = None + new_poster, new_background, item_dir, name = None, None, None, None try: tmdb_item = tmdb_obj() except Failed: tmdb_item = None + if self.library.mass_poster_update: - self.library.poster_update(item, new_poster, tmdb=tmdb_item.poster_url if tmdb_item else None, title=item.title) # noqa + source = self.library.mass_poster_update["source"] + ignore_locked = self.library.mass_poster_update["ignore_locked"] + ignore_overlays = self.library.mass_poster_update.get("ignore_overlays") + thumb_locked = any(f.name == "thumb" and f.locked for f in item.fields) + labels = [la.tag for la in self.library.item_labels(item)] + has_overlay_label = "Overlay" in labels + + # Bypass ignore_locked and ignore_overlays checks if the source is "unlock" or "lock" + if source in ["unlock", "lock"]: + self.library.poster_update(item, new_poster, tmdb=tmdb_item.poster_url if tmdb_item else None, title=item.title) # noqa + elif ignore_locked and thumb_locked: + # Skip processing if ignore_locked is True and thumb is locked + pass + elif ignore_overlays and has_overlay_label: + # Skip processing if ignore_overlays is True and Overlay label is found + pass + else: + self.library.poster_update(item, new_poster, tmdb=tmdb_item.poster_url if tmdb_item else None, title=item.title) # noqa + if self.library.mass_background_update: - self.library.background_update(item, new_background, tmdb=tmdb_item.backdrop_url if tmdb_item else None, title=item.title) # noqa + source = self.library.mass_background_update["source"] + ignore_locked = self.library.mass_background_update["ignore_locked"] + ignore_overlays = self.library.mass_poster_update["ignore_overlays"] + art_locked = any(f.name == "art" and f.locked for f in item.fields) + + if source in ["unlock", "lock"]: + self.library.background_update(item, new_background, tmdb=tmdb_item.backdrop_url if tmdb_item else None, title=item.title) # noqa + + elif not (ignore_locked and art_locked): + self.library.background_update(item, new_background, tmdb=tmdb_item.backdrop_url if tmdb_item else None, title=item.title) # noqa + if self.library.is_show and ( (self.library.mass_poster_update and