Skip to content

Commit

Permalink
add item_analyze
Browse files Browse the repository at this point in the history
  • Loading branch information
meisnate12 committed Sep 30, 2024
1 parent bee157a commit c02f79b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/files/item_updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ tags:
- item_audio_language
- item_subtitle_language
- item_subtitle_mode
- item_analyze
---

# Item Metadata Updates
Expand All @@ -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_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_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_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> |
Expand Down
7 changes: 5 additions & 2 deletions modules/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
collectionless_details = ["collection_order", "plex_collectionless", "label", "label_sync_mode", "test", "item_label"] + \
poster_details + background_details + summary_details + string_details + all_builders
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())
none_details = ["label.sync", "item_label.sync", "item_genre.sync", "radarr_taglist", "sonarr_taglist", "item_edition"]
none_builders = ["radarr_tag_list", "sonarr_taglist"]
Expand Down Expand Up @@ -169,7 +169,7 @@
"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",
"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
playlist_attributes = [
"filters", "name_mapping", "show_filtered", "show_missing", "save_report", "allowed_library_types", "run_definition",
Expand Down Expand Up @@ -3230,6 +3230,9 @@ def update_item_details(self):
time.sleep(delay)
self.library.query(item.refresh)

if "item_analyze" in self.item_details:
item.analyze()

if self.library.Radarr and tmdb_paths:
try:
if "item_radarr_tag" in self.item_details:
Expand Down

0 comments on commit c02f79b

Please sign in to comment.