From 54133342b6d028d58f1898d4f59e6b55204ae155 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Mon, 14 Feb 2022 17:36:30 -0500 Subject: [PATCH] [68] #579 add max_size filter --- VERSION | 2 +- modules/builder.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index cae83632..e436d9f7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.15.1-develop67 +1.15.1-develop68 diff --git a/modules/builder.py b/modules/builder.py index 952f41a2..e5d59b15 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -120,7 +120,7 @@ discover_status = { "Ended": "ended", "Canceled": "canceled", "Pilot": "pilot" } filters_by_type = { - "movie_show_season_episode_artist_album_track": ["title", "summary", "collection", "has_collection", "added", "last_played", "user_rating", "plays"], + "movie_show_season_episode_artist_album_track": ["title", "summary", "collection", "has_collection", "added", "last_played", "user_rating", "plays", "max_size"], "movie_show_season_episode_album_track": ["year"], "movie_show_episode_artist_track": ["filepath"], "movie_show_episode_album": ["release", "critic_rating", "history"], @@ -157,7 +157,7 @@ date_filters = ["release", "added", "last_played", "first_episode_aired", "last_ date_modifiers = ["", ".not", ".before", ".after", ".regex"] number_filters = ["year", "tmdb_year", "critic_rating", "audience_rating", "user_rating", "tmdb_vote_count", "plays", "duration"] number_modifiers = [".gt", ".gte", ".lt", ".lte"] -special_filters = ["history"] +special_filters = ["history", "max_size"] all_filters = boolean_filters + special_filters + \ [f"{f}{m}" for f in string_filters for m in string_modifiers] + \ [f"{f}{m}" for f in tag_filters for m in tag_modifiers] + \ @@ -1745,7 +1745,7 @@ class CollectionBuilder: for value in values: final_years.append(util.parse(self.Type, final, value, datatype="int")) return smart_pair(final_years) - elif (attribute in plex.number_attributes + plex.date_attributes + plex.year_attributes + ["tmdb_year"] and modifier in ["", ".not", ".gt", ".gte", ".lt", ".lte"]) \ + elif (attribute in plex.number_attributes + plex.date_attributes + plex.year_attributes + ["tmdb_year", "max_size"] and modifier in ["", ".not", ".gt", ".gte", ".lt", ".lte"]) \ or (attribute in plex.tag_attributes and modifier in [".count_gt", ".count_gte", ".count_lt", ".count_lte"]): return util.parse(self.Type, final, data, datatype="int") elif attribute in plex.float_attributes and modifier in [".gt", ".gte", ".lt", ".lte"]: @@ -1970,6 +1970,9 @@ class CollectionBuilder: filter_check = True if util.is_boolean_filter(filter_data, filter_check): return False + elif filter_attr == "max_size": + if len(self.added_items) + self.beginning_count >= filter_data: + return False elif filter_attr == "history": item_date = item.originallyAvailableAt if item_date is None: