[54] Adds item_analyze item detail (#2249)

This commit is contained in:
meisnate12 2024-09-30 10:45:06 -04:00 committed by GitHub Action
parent bee157ae34
commit 4b001d86e8
4 changed files with 10 additions and 3 deletions

View file

@ -13,6 +13,7 @@ Update tmdbapis requirement to 1.2.21
# New Features # New Features
Introducing the [Kometa Blog](https://blog.kometa.wiki) - a new home for all kometa-related news stories, ranging from showcasing our community creations to providing you with important updates. Introducing the [Kometa Blog](https://blog.kometa.wiki) - a new home for all kometa-related news stories, ranging from showcasing our community creations to providing you with important updates.
Added [`letterboxd_user_lists`](https://kometa.wiki/en/latest/files/dynamic_types/#letterboxd-user-lists) Dynamic Collection Type Added [`letterboxd_user_lists`](https://kometa.wiki/en/latest/files/dynamic_types/#letterboxd-user-lists) Dynamic Collection Type
Added `item_analyze` item detail to analyze each item in a collection
# Updates # Updates
F1 session naming improvements F1 session naming improvements

View file

@ -1 +1 @@
2.0.2-build53 2.0.2-build54

View file

@ -31,6 +31,7 @@ tags:
- item_audio_language - item_audio_language
- item_subtitle_language - item_subtitle_language
- item_subtitle_mode - item_subtitle_mode
- item_analyze
--- ---
# Item Metadata Updates # Item Metadata Updates
@ -55,6 +56,7 @@ All the following attributes update various details of the metadata for every it
| `item_assets` | **Description:** Checks your assets folders for assets of every movie/show in the collection<br>**Default:** `false`<br>**Values:** `true` or `false` | | `item_assets` | **Description:** Checks your assets folders for assets of every movie/show in the collection<br>**Default:** `false`<br>**Values:** `true` or `false` |
| `item_refresh` | **Description:** Refreshes the metadata of every movie/show in the collection<br>**Default:** `false`<br>**Values:** `true` or `false` | | `item_refresh` | **Description:** Refreshes the metadata of every movie/show in the collection<br>**Default:** `false`<br>**Values:** `true` or `false` |
| `item_refresh_delay` | **Description:** Amount of time to wait between each `item_refresh` of every movie/show in the collection<br>**Default:** `0`<br>**Values:** Number greater than `0` | | `item_refresh_delay` | **Description:** Amount of time to wait between each `item_refresh` of every movie/show in the collection<br>**Default:** `0`<br>**Values:** Number greater than `0` |
| `item_analyze` | **Description:** Runs Plex's Analyze Operation on every movie/show in the collection<br>**Default:** `false`<br>**Values:** `true` or `false` |
| `item_tmdb_season_titles` | **Description:** Changes the season titles of every show in the collection to match TMDb<br>**Default:** `false`<br>**Values:** `true` or `false` | | `item_tmdb_season_titles` | **Description:** Changes the season titles of every show in the collection to match TMDb<br>**Default:** `false`<br>**Values:** `true` or `false` |
| `item_episode_sorting`<sup>1</sup> | **Description:** Changes the episode sorting of every show in the collection<br>**Values:**<table class="clearTable"><tr><td>`default`</td><td>Library default</td></tr><tr><td>`oldest`</td><td>Oldest first</td></tr><tr><td>`newest`</td><td>Newest first</td></tr></table> | | `item_episode_sorting`<sup>1</sup> | **Description:** Changes the episode sorting of every show in the collection<br>**Values:**<table class="clearTable"><tr><td>`default`</td><td>Library default</td></tr><tr><td>`oldest`</td><td>Oldest first</td></tr><tr><td>`newest`</td><td>Newest first</td></tr></table> |
| `item_keep_episodes`<sup>1</sup> | **Description:** Changes the keep episodes of every show in the collection<br>**Values:**<table class="clearTable"><tr><td>`all`</td><td>All episodes</td></tr><tr><td>`5_latest`</td><td>5 latest episodes</td></tr><tr><td>`3_latest`</td><td>3 latest episodes</td></tr><tr><td>`latest`</td><td>Latest episodes</td></tr><tr><td>`past_3`</td><td>Episodes added in the past 3 days</td></tr><tr><td>`past_7`</td><td>Episodes added in the past 7 days</td></tr><tr><td>`past_30`</td><td>Episodes added in the past 30 days</td></tr></table> | | `item_keep_episodes`<sup>1</sup> | **Description:** Changes the keep episodes of every show in the collection<br>**Values:**<table class="clearTable"><tr><td>`all`</td><td>All episodes</td></tr><tr><td>`5_latest`</td><td>5 latest episodes</td></tr><tr><td>`3_latest`</td><td>3 latest episodes</td></tr><tr><td>`latest`</td><td>Latest episodes</td></tr><tr><td>`past_3`</td><td>Episodes added in the past 3 days</td></tr><tr><td>`past_7`</td><td>Episodes added in the past 7 days</td></tr><tr><td>`past_30`</td><td>Episodes added in the past 30 days</td></tr></table> |

View file

@ -56,7 +56,7 @@ details = [
collectionless_details = ["collection_order", "plex_collectionless", "label", "label_sync_mode", "test", "item_label"] + \ collectionless_details = ["collection_order", "plex_collectionless", "label", "label_sync_mode", "test", "item_label"] + \
poster_details + background_details + summary_details + string_details + all_builders poster_details + background_details + summary_details + string_details + all_builders
item_false_details = ["item_lock_background", "item_lock_poster", "item_lock_title"] item_false_details = ["item_lock_background", "item_lock_poster", "item_lock_title"]
item_bool_details = ["item_tmdb_season_titles", "revert_overlay", "item_assets", "item_refresh"] + item_false_details item_bool_details = ["item_tmdb_season_titles", "revert_overlay", "item_assets", "item_refresh", "item_analyze"] + item_false_details
item_details = ["non_item_remove_label", "item_label", "item_genre", "item_edition", "item_radarr_tag", "item_sonarr_tag", "item_refresh_delay"] + item_bool_details + list(plex.item_advance_keys.keys()) item_details = ["non_item_remove_label", "item_label", "item_genre", "item_edition", "item_radarr_tag", "item_sonarr_tag", "item_refresh_delay"] + item_bool_details + list(plex.item_advance_keys.keys())
none_details = ["label.sync", "item_label.sync", "item_genre.sync", "radarr_taglist", "sonarr_taglist", "item_edition"] none_details = ["label.sync", "item_label.sync", "item_genre.sync", "radarr_taglist", "sonarr_taglist", "item_edition"]
none_builders = ["radarr_tag_list", "sonarr_taglist"] none_builders = ["radarr_tag_list", "sonarr_taglist"]
@ -169,7 +169,7 @@ parts_collection_valid = [
"filters", "plex_all", "plex_search", "trakt_list", "trakt_list_details", "collection_filtering", "collection_mode", "label", "visible_library", "limit", "filters", "plex_all", "plex_search", "trakt_list", "trakt_list_details", "collection_filtering", "collection_mode", "label", "visible_library", "limit",
"visible_home", "visible_shared", "show_missing", "save_report", "missing_only_released", "server_preroll", "changes_webhooks", "visible_home", "visible_shared", "show_missing", "save_report", "missing_only_released", "server_preroll", "changes_webhooks",
"item_lock_background", "item_lock_poster", "item_lock_title", "item_refresh", "item_refresh_delay", "imdb_list", "imdb_search", "item_lock_background", "item_lock_poster", "item_lock_title", "item_refresh", "item_refresh_delay", "imdb_list", "imdb_search",
"cache_builders", "url_theme", "file_theme", "item_label", "default_percent", "non_item_remove_label" "cache_builders", "url_theme", "file_theme", "item_label", "default_percent", "non_item_remove_label", "item_analyze"
] + episode_parts_only + summary_details + poster_details + background_details + string_details ] + episode_parts_only + summary_details + poster_details + background_details + string_details
playlist_attributes = [ playlist_attributes = [
"filters", "name_mapping", "show_filtered", "show_missing", "save_report", "allowed_library_types", "run_definition", "filters", "name_mapping", "show_filtered", "show_missing", "save_report", "allowed_library_types", "run_definition",
@ -3230,6 +3230,10 @@ class CollectionBuilder:
time.sleep(delay) time.sleep(delay)
self.library.query(item.refresh) self.library.query(item.refresh)
if "item_analyze" in self.item_details:
logger.info(f"Executing Analyze on {item.title}")
item.analyze()
if self.library.Radarr and tmdb_paths: if self.library.Radarr and tmdb_paths:
try: try:
if "item_radarr_tag" in self.item_details: if "item_radarr_tag" in self.item_details: