From 5d2aeb770b1f20c1e2db7c3facf5a589e3ccefe1 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Thu, 2 Mar 2023 11:02:05 -0500 Subject: [PATCH] [113] added has_edition filter --- VERSION | 2 +- docs/metadata/filters.md | 11 ++++++----- modules/builder.py | 4 ++-- modules/plex.py | 2 ++ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index a201c8c9..1c20a861 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.3-develop112 +1.18.3-develop113 diff --git a/docs/metadata/filters.md b/docs/metadata/filters.md index fd05224c..f6fd3f80 100644 --- a/docs/metadata/filters.md +++ b/docs/metadata/filters.md @@ -127,11 +127,12 @@ Boolean Filters have no modifiers. ### Attribute -| Boolean Filters | Description | Movies | Shows | Seasons | Episodes | Artists | Albums | Track | -|:--------------------|:------------------------------------------------------------|:-------:|:-------------------:|:-------------------:|:--------:|:--------:|:--------:|:--------:| -| `has_collection` | Matches every item that has or does not have a collection | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| `has_dolby_vision` | Matches every item that has or does not have a dolby vision | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | -| `has_overlay` | Matches every item that has or does not have an overlay | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | +| Boolean Filters | Description | Movies | Shows | Seasons | Episodes | Artists | Albums | Track | +|:-------------------|:------------------------------------------------------------|:-------:|:-------------------:|:-------------------:|:--------:|:--------:|:--------:|:--------:| +| `has_collection` | Matches every item that has or does not have a collection | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| `has_edition` | Matches every item that has or does not have an edition | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | +| `has_dolby_vision` | Matches every item that has or does not have a dolby vision | ✅ | ✅1 | ✅1 | ✅ | ❌ | ❌ | ❌ | +| `has_overlay` | Matches every item that has or does not have an overlay | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | 1 Filters using the special `episodes` [filter](#special-filters) with the [default percent](details/definition). diff --git a/modules/builder.py b/modules/builder.py index adaa70a4..1f10ec54 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -84,7 +84,7 @@ filters_by_type = { "show_artist": ["folder"], "show_season": ["episodes"], "artist_album": ["tracks"], - "movie": ["edition"], + "movie": ["edition", "has_edition"], "show": ["seasons", "tmdb_status", "tmdb_type", "origin_country", "network", "first_episode_aired", "last_episode_aired", "last_episode_aired_or_never"], "artist": ["albums"], "album": ["record_label"] @@ -113,7 +113,7 @@ tag_filters = [ "origin_country", "writer", "resolution", "audio_language", "subtitle_language", "tmdb_keyword", "tmdb_genre", "imdb_keyword" ] tag_modifiers = ["", ".not", ".regex", ".count_gt", ".count_gte", ".count_lt", ".count_lte"] -boolean_filters = ["has_collection", "has_overlay", "has_dolby_vision"] +boolean_filters = ["has_collection", "has_edition", "has_overlay", "has_dolby_vision"] date_filters = ["release", "added", "last_played", "first_episode_aired", "last_episode_aired", "last_episode_aired_or_never"] date_modifiers = ["", ".not", ".before", ".after", ".regex"] number_filters = [ diff --git a/modules/plex.py b/modules/plex.py index 6c5eb45e..a85d1b99 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -1572,6 +1572,8 @@ class Plex(Library): filter_check = False if filter_attr == "has_collection": filter_check = len(item.collections) > 0 + elif filter_attr == "has_edition": + filter_check = True if item.edition else False elif filter_attr == "has_overlay": for label in self.item_labels(item): if label.tag.lower().endswith(" overlay") or label.tag.lower() == "overlay":