diff --git a/VERSION b/VERSION index 747ffdd1..615a4ba3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.17.3-develop37 +1.17.3-develop38 diff --git a/docs/metadata/filters.md b/docs/metadata/filters.md index c43f6d8f..319b8ffd 100644 --- a/docs/metadata/filters.md +++ b/docs/metadata/filters.md @@ -40,6 +40,10 @@ String filters can take multiple values **only as a list**. | `folder` | Uses the item's folder to match | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | | `filepath` | Uses the item's filepath to match | ✅ | ✅1 | ✅1 | ✅ | ✅1 | ✅1 | ✅ | | `audio_track_title` | Uses the audio track titles to match | ✅ | ✅1 | ✅1 | ✅ | ✅1 | ✅1 | ✅ | +| `video_codec` | Uses the video codec tags to match | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | +| `video_profile` | Uses the video profile tags to match | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | +| `audio_codec` | Uses the audio codec tags to match | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | +| `audio_profile` | Uses the audio profile tags to match | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | 1 Filters using the special `episodes`/`tracks` [filter](#special-filters) with the [default percent](details/setting). @@ -81,10 +85,6 @@ Tag filters can take multiple values as a **list or a comma-separated string**. | `resolution` | Uses the resolution tag to match | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | | `audio_language` | Uses the audio language tags to match | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | | `subtitle_language` | Uses the subtitle language tags to match | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | -| `video_codec` | Uses the video codec tags to match | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | -| `video_profile` | Uses the video profile tags to match | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | -| `audio_codec` | Uses the audio codec tags to match | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | -| `audio_profile` | Uses the audio profile tags to match | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | | `tmdb_genre`2 | Uses the genre from TMDb to match | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | | `tmdb_keyword`2 | Uses the keyword from TMDb to match | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | | `origin_country`2 | Uses TMDb origin country [ISO 3166-1 alpha-2 codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) to match
Example: `origin_country: us` | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | diff --git a/modules/builder.py b/modules/builder.py index a8294eb9..789fcb26 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -107,12 +107,14 @@ tmdb_filters = [ "original_language", "origin_country", "tmdb_vote_count", "tmdb_year", "tmdb_keyword", "tmdb_genre", "first_episode_aired", "last_episode_aired", "last_episode_aired_or_never", "tmdb_status", "tmdb_type", "tmdb_title" ] -string_filters = ["title", "summary", "studio", "record_label", "folder", "filepath", "audio_track_title", "tmdb_title"] +string_filters = [ + "title", "summary", "studio", "record_label", "folder", "filepath", "audio_track_title", "tmdb_title", + "audio_codec", "audio_profile", "video_codec", "video_profile" +] string_modifiers = ["", ".not", ".is", ".isnot", ".begins", ".ends", ".regex"] tag_filters = [ "actor", "collection", "content_rating", "country", "director", "network", "genre", "label", "producer", "year", - "origin_country", "writer", "resolution", "audio_language", "subtitle_language", "tmdb_keyword", "tmdb_genre", - "audio_codec", "audio_profile", "video_codec", "video_profile" + "origin_country", "writer", "resolution", "audio_language", "subtitle_language", "tmdb_keyword", "tmdb_genre" ] tag_modifiers = ["", ".not", ".regex", ".count_gt", ".count_gte", ".count_lt", ".count_lte"] boolean_filters = ["has_collection", "has_overlay", "has_dolby_vision"] @@ -134,7 +136,8 @@ all_filters = boolean_filters + special_filters + \ date_attributes = plex.date_attributes + ["first_episode_aired", "last_episode_aired", "last_episode_aired_or_never"] year_attributes = plex.year_attributes + ["tmdb_year"] number_attributes = plex.number_attributes + ["channels", "height", "width"] -tag_attributes = plex.tag_attributes + ["audio_codec", "audio_profile", "video_codec", "video_profile"] +tag_attributes = plex.tag_attributes +string_attributes = plex.string_attributes + string_filters float_attributes = plex.float_attributes + ["aspect"] boolean_attributes = plex.boolean_attributes + boolean_filters smart_invalid = ["collection_order", "builder_level"] @@ -1957,7 +1960,7 @@ class CollectionBuilder: return valid_list elif modifier == ".regex": return util.validate_regex(data, self.Type, validate=validate) - elif attribute in plex.string_attributes + string_filters and modifier in ["", ".not", ".is", ".isnot", ".begins", ".ends"]: + elif attribute in string_attributes and modifier in ["", ".not", ".is", ".isnot", ".begins", ".ends"]: return smart_pair(util.get_list(data, split=False)) elif attribute == "origin_country": return util.get_list(data, upper=True) diff --git a/modules/plex.py b/modules/plex.py index dc473c5b..08f53017 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -1443,12 +1443,7 @@ class Plex(Library): elif filter_attr in builder.number_filters or modifier in [".gt", ".gte", ".lt", ".lte", ".count_gt", ".count_gte", ".count_lt", ".count_lte"]: divider = 60000 if filter_attr == "duration" else 1 test_number = [] - if filter_attr in ["resolution", "audio_codec", "audio_profile", "video_codec", "video_profile"]: - for media in item.media: - attr = getattr(media, filter_actual) - if attr and attr not in test_number: - test_number.append(attr) - elif filter_attr in ["channels", "height", "width", "aspect"]: + if filter_attr in ["channels", "height", "width", "aspect"]: test_number = 0 for media in item.media: attr = getattr(media, filter_actual)