[35] add season_collection and episode_collection to plex search

pull/811/head
meisnate12 3 years ago
parent c5cd72c777
commit 4772df82ae

@ -1 +1 @@
1.16.2-develop34 1.16.2-develop35

@ -173,10 +173,12 @@ Tag search can take multiple values as a **list or a comma-separated string**.
### Tag Attributes ### Tag Attributes
| Tag Search | Description | Movie<br>Libraries | Show<br>Libraries | Music<br>Libraries | | Tag Search | Description | Movie<br>Libraries | Show<br>Libraries | Music<br>Libraries |
|:--------------------|:----------------------------------------------------------------------------|:------------------:|:-----------------:|:------------------:| |:---------------------|:----------------------------------------------------------------------------|:------------------:|:-----------------:|:------------------:|
| `actor` | Uses the actor tags to match | &#9989; | &#9989; | &#10060; | | `actor` | Uses the actor tags to match | &#9989; | &#9989; | &#10060; |
| `audio_language` | Uses the audio language tags to match | &#9989; | &#9989; | &#10060; | | `audio_language` | Uses the audio language tags to match | &#9989; | &#9989; | &#10060; |
| `collection` | Uses the collection tags to match | &#9989; | &#9989; | &#10060; | | `collection` | Uses the collection tags to match for top level collections | &#9989; | &#9989; | &#10060; |
| `season_collection` | Uses the collection tags to match for season collections | &#10060; | &#9989; | &#10060; |
| `episode_collection` | Uses the collection tags to match for episode collections | &#10060; | &#9989; | &#10060; |
| `content_rating` | Uses the content rating tags to match | &#9989; | &#9989; | &#10060; | | `content_rating` | Uses the content rating tags to match | &#9989; | &#9989; | &#10060; |
| `country` | Uses the country tags to match | &#9989; | &#10060; | &#10060; | | `country` | Uses the country tags to match | &#9989; | &#10060; | &#10060; |
| `decade` | Uses the year tag to match the decade | &#9989; | &#10060; | &#10060; | | `decade` | Uses the year tag to match the decade | &#9989; | &#10060; | &#10060; |

@ -140,10 +140,12 @@ Tag filter can take multiple values as a **list or a comma-separated string**.
### Tag Attributes ### Tag Attributes
| Tag Search | Description | Movie<br>Libraries | Show<br>Libraries | Music<br>Libraries | | Tag Search | Description | Movie<br>Libraries | Show<br>Libraries | Music<br>Libraries |
|:--------------------|:----------------------------------------------------------------------------|:------------------:|:-----------------:|:------------------:| |:---------------------|:----------------------------------------------------------------------------|:------------------:|:-----------------:|:------------------:|
| `actor` | Uses the actor tags to match | &#9989; | &#9989; | &#10060; | | `actor` | Uses the actor tags to match | &#9989; | &#9989; | &#10060; |
| `audio_language` | Uses the audio language tags to match | &#9989; | &#9989; | &#10060; | | `audio_language` | Uses the audio language tags to match | &#9989; | &#9989; | &#10060; |
| `collection` | Uses the collection tags to match | &#9989; | &#9989; | &#10060; | | `collection` | Uses the collection tags to match for top level collections | &#9989; | &#9989; | &#10060; |
| `season_collection` | Uses the collection tags to match for season collections | &#10060; | &#9989; | &#10060; |
| `episode_collection` | Uses the collection tags to match for episode collections | &#10060; | &#9989; | &#10060; |
| `content_rating` | Uses the content rating tags to match | &#9989; | &#9989; | &#10060; | | `content_rating` | Uses the content rating tags to match | &#9989; | &#9989; | &#10060; |
| `country` | Uses the country tags to match | &#9989; | &#10060; | &#10060; | | `country` | Uses the country tags to match | &#9989; | &#10060; | &#10060; |
| `decade` | Uses the year tag to match the decade | &#9989; | &#10060; | &#10060; | | `decade` | Uses the year tag to match the decade | &#9989; | &#10060; | &#10060; |

@ -2563,7 +2563,8 @@ class CollectionBuilder:
if self.custom_sort is True: if self.custom_sort is True:
items = self.added_items items = self.added_items
else: else:
search_data = self.build_filter("plex_search", {"sort_by": self.custom_sort, "any": {"collection": self.name}}) collection_type = f"{self.collection_level}_collection" if self.collection_level in ["season", "episode"] else "collection"
search_data = self.build_filter("plex_search", {"sort_by": self.custom_sort, "any": {collection_type: self.name}})
items = self.library.get_filter_items(search_data[2]) items = self.library.get_filter_items(search_data[2])
previous = None previous = None
for item in items: for item in items:

@ -45,6 +45,8 @@ search_translation = {
"progress": "inProgress", "progress": "inProgress",
"episode_progress": "episode.inProgress", "episode_progress": "episode.inProgress",
"unplayed_episodes": "show.unwatchedLeaves", "unplayed_episodes": "show.unwatchedLeaves",
"season_collection": "season.collection",
"episode_collection": "episode.collection",
"artist_title": "artist.title", "artist_title": "artist.title",
"artist_user_rating": "artist.userRating", "artist_user_rating": "artist.userRating",
"artist_genre": "artist.genre", "artist_genre": "artist.genre",
@ -191,6 +193,8 @@ searches = [
"actor", "actor.not", "actor", "actor.not",
"audio_language", "audio_language.not", "audio_language", "audio_language.not",
"collection", "collection.not", "collection", "collection.not",
"season_collection", "season_collection.not",
"episode_collection", "episode_collection.not",
"content_rating", "content_rating.not", "content_rating", "content_rating.not",
"country", "country.not", "country", "country.not",
"director", "director.not", "director", "director.not",
@ -236,6 +240,8 @@ movie_only_searches = [
] ]
show_only_searches = [ show_only_searches = [
"network", "network.not", "network", "network.not",
"season_collection", "season_collection.not",
"episode_collection", "episode_collection.not",
"episode_title", "episode_title.not", "episode_title.is", "episode_title.isnot", "episode_title.begins", "episode_title.ends", "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_added", "episode_added.not", "episode_added.before", "episode_added.after",
"episode_air_date", "episode_air_date.not", "episode_air_date", "episode_air_date.not",
@ -266,9 +272,9 @@ number_attributes = ["plays", "episode_plays", "tmdb_vote_count", "album_plays",
search_display = {"added": "Date Added", "release": "Release Date", "hdr": "HDR", "progress": "In Progress", "episode_progress": "Episode In Progress"} search_display = {"added": "Date Added", "release": "Release Date", "hdr": "HDR", "progress": "In Progress", "episode_progress": "Episode In Progress"}
tag_attributes = [ tag_attributes = [
"actor", "audio_language", "collection", "content_rating", "country", "director", "genre", "label", "network", "actor", "audio_language", "collection", "content_rating", "country", "director", "genre", "label", "network",
"producer", "resolution", "studio", "subtitle_language", "writer", "artist_genre", "artist_collection", "producer", "resolution", "studio", "subtitle_language", "writer", "season_collection", "episode_collection",
"artist_country", "artist_mood", "artist_style", "album_genre", "album_mood", "album_style", "album_format", "artist_genre", "artist_collection", "artist_country", "artist_mood", "artist_style", "album_genre", "album_mood",
"album_type", "album_collection", "album_source", "album_label", "track_mood", "track_source" "album_style", "album_format", "album_type", "album_collection", "album_source", "album_label", "track_mood", "track_source"
] ]
movie_sorts = { movie_sorts = {
"title.asc": "titleSort", "title.desc": "titleSort%3Adesc", "title.asc": "titleSort", "title.desc": "titleSort%3Adesc",

Loading…
Cancel
Save