From df85da05e704a028535f191d1ef316f44d4e6761 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 19 Oct 2022 16:13:01 -0400 Subject: [PATCH] [136] add new label plex_search attributes --- VERSION | 2 +- docs/metadata/builders/plex.md | 6 +++++- docs/metadata/builders/smart.md | 6 +++++- modules/builder.py | 1 - modules/plex.py | 12 +++++++++--- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 443f52f8..776b5d49 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.17.3-develop135 +1.17.3-develop136 diff --git a/docs/metadata/builders/plex.md b/docs/metadata/builders/plex.md index 444501b5..f3225c00 100644 --- a/docs/metadata/builders/plex.md +++ b/docs/metadata/builders/plex.md @@ -215,7 +215,9 @@ Tag search can take multiple values as a **list or a comma-separated string**. | `decade` | Uses the year tag to match the decade | ✅ | ❌ | ❌ | | `director` | Uses the director tags to match | ✅ | ❌ | ❌ | | `genre` | Uses the genre tags to match | ✅ | ✅ | ❌ | -| `label` | Uses the label tags to match | ✅ | ✅ | ❌ | +| `label` | Uses the label tags to match for top level collections | ✅ | ✅ | ❌ | +| `season_label` | Uses the label tags to match for season collections | ❌ | ✅ | ❌ | +| `episode_label` | Uses the label tags to match for episode collections | ❌ | ✅ | ❌ | | `network` | Uses the network tags to match
**Only works with the New Plex TV Agent** | ❌ | ✅ | ❌ | | `producer` | Uses the actor tags to match | ✅ | ❌ | ❌ | | `resolution` | Uses the resolution tags to match | ✅ | ✅ | ❌ | @@ -228,6 +230,7 @@ Tag search can take multiple values as a **list or a comma-separated string**. | `artist_country` | Uses the Artist's Country attribute to match | ❌ | ❌ | ✅ | | `artist_mood` | Uses the Artist's Mood attribute to match | ❌ | ❌ | ✅ | | `artist_style` | Uses the Artist's Style attribute to match | ❌ | ❌ | ✅ | +| `artist_label` | Uses the Artist's Label attribute to match | ❌ | ❌ | ✅ | | `album_genre` | Uses the Album's Genre attribute to match | ❌ | ❌ | ✅ | | `album_mood` | Uses the Album's Mood attribute to match | ❌ | ❌ | ✅ | | `album_style` | Uses the Album's Style attribute to match | ❌ | ❌ | ✅ | @@ -238,6 +241,7 @@ Tag search can take multiple values as a **list or a comma-separated string**. | `album_label` | Uses the Album's Label attribute to match | ❌ | ❌ | ✅ | | `track_mood` | Uses the Track's Mood attribute to match | ❌ | ❌ | ✅ | | `track_source` | Uses the Track's Style attribute to match | ❌ | ❌ | ✅ | +| `track_label` | Uses the Track's Label attribute to match | ❌ | ❌ | ✅ | ## Date Searches diff --git a/docs/metadata/builders/smart.md b/docs/metadata/builders/smart.md index 8ef82af6..db720a40 100644 --- a/docs/metadata/builders/smart.md +++ b/docs/metadata/builders/smart.md @@ -156,7 +156,9 @@ Tag filter can take multiple values as a **list or a comma-separated string**. | `decade` | Uses the year tag to match the decade | ✅ | ❌ | ❌ | | `director` | Uses the director tags to match | ✅ | ❌ | ❌ | | `genre` | Uses the genre tags to match | ✅ | ✅ | ❌ | -| `label` | Uses the label tags to match | ✅ | ✅ | ❌ | +| `label` | Uses the label tags to match for top level collections | ✅ | ✅ | ❌ | +| `season_label` | Uses the label tags to match for season collections | ❌ | ✅ | ❌ | +| `episode_label` | Uses the label tags to match for episode collections | ❌ | ✅ | ❌ | | `network` | Uses the network tags to match
**Only works with the New Plex TV Agent** | ❌ | ✅ | ❌ | | `producer` | Uses the actor tags to match | ✅ | ❌ | ❌ | | `resolution` | Uses the resolution tags to match | ✅ | ✅ | ❌ | @@ -169,6 +171,7 @@ Tag filter can take multiple values as a **list or a comma-separated string**. | `artist_country` | Uses the Artist's Country attribute to match | ❌ | ❌ | ✅ | | `artist_mood` | Uses the Artist's Mood attribute to match | ❌ | ❌ | ✅ | | `artist_style` | Uses the Artist's Style attribute to match | ❌ | ❌ | ✅ | +| `artist_label` | Uses the Artist's Label attribute to match | ❌ | ❌ | ✅ | | `album_genre` | Uses the Album's Genre attribute to match | ❌ | ❌ | ✅ | | `album_mood` | Uses the Album's Mood attribute to match | ❌ | ❌ | ✅ | | `album_style` | Uses the Album's Style attribute to match | ❌ | ❌ | ✅ | @@ -179,6 +182,7 @@ Tag filter can take multiple values as a **list or a comma-separated string**. | `album_label` | Uses the Album's Label attribute to match | ❌ | ❌ | ✅ | | `track_mood` | Uses the Track's Mood attribute to match | ❌ | ❌ | ✅ | | `track_source` | Uses the Track's Style attribute to match | ❌ | ❌ | ✅ | +| `track_label` | Uses the Track's Label attribute to match | ❌ | ❌ | ✅ | ## Date Filters diff --git a/modules/builder.py b/modules/builder.py index 6121e59e..91ecf84f 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -1880,7 +1880,6 @@ class CollectionBuilder: def build_url_arg(arg, mod=None, arg_s=None, mod_s=None): arg_key = plex.search_translation[attr] if attr in plex.search_translation else attr - arg_key = f"{sort_type}.label" if arg_key == "label" and sort_type in ["season", "episode", "album", "track"] else arg_key arg_key = plex.show_translation[arg_key] if self.library.is_show and arg_key in plex.show_translation else arg_key if mod is None: mod = plex.modifier_translation[modifier] if modifier in plex.modifier_translation else modifier diff --git a/modules/plex.py b/modules/plex.py index 8f3281d1..0c10636d 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -51,6 +51,8 @@ search_translation = { "unplayed_episodes": "show.unwatchedLeaves", "season_collection": "season.collection", "episode_collection": "episode.collection", + "season_label": "season.label", + "episode_label": "episode.label", "artist_title": "artist.title", "artist_user_rating": "artist.userRating", "artist_genre": "artist.genre", @@ -61,6 +63,7 @@ search_translation = { "artist_added": "artist.addedAt", "artist_last_played": "artist.lastViewedAt", "artist_unmatched": "artist.unmatched", + "artist_label": "artist.label", "album_title": "album.title", "album_year": "album.year", "album_decade": "album.decade", @@ -90,7 +93,8 @@ search_translation = { "track_last_rated": "track.lastRatedAt", "track_added": "track.addedAt", "track_trash": "track.trash", - "track_source": "track.source" + "track_source": "track.source", + "track_label": "track.label" } show_translation = { "title": "show.title", @@ -254,6 +258,8 @@ show_only_searches = [ "network", "network.not", "season_collection", "season_collection.not", "episode_collection", "episode_collection.not", + "season_label", "season_label.not", + "episode_label", "episode_label.not", "episode_title", "episode_title.not", "episode_title.is", "episode_title.isnot", "episode_title.begins", "episode_title.ends", "episode_added", "episode_added.not", "episode_added.before", "episode_added.after", "episode_air_date", "episode_air_date.not", @@ -291,8 +297,8 @@ search_display = {"added": "Date Added", "release": "Release Date", "hdr": "HDR" tag_attributes = [ "actor", "audio_language", "collection", "content_rating", "country", "director", "genre", "label", "network", "producer", "resolution", "studio", "subtitle_language", "writer", "season_collection", "episode_collection", "edition", - "artist_genre", "artist_collection", "artist_country", "artist_mood", "artist_style", "album_genre", "album_mood", - "album_style", "album_format", "album_type", "album_collection", "album_source", "album_label", "track_mood", "track_source" + "artist_genre", "artist_collection", "artist_country", "artist_mood", "artist_label", "artist_style", "album_genre", "album_mood", + "album_style", "album_format", "album_type", "album_collection", "album_source", "album_label", "track_mood", "track_source", "track_label" ] tag_modifiers = ["", ".not", ".regex"] no_not_mods = ["resolution", "decade", "album_decade"]