added summary filter

pull/590/head
meisnate12 3 years ago
parent 6c79676cb3
commit 01a6297742

@ -109,7 +109,7 @@ sonarr_details = [
] ]
album_details = ["item_label", "item_album_sorting"] album_details = ["item_label", "item_album_sorting"]
filters_by_type = { filters_by_type = {
"movie_show_season_episode_artist_album_track": ["title", "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"],
"movie_show_season_episode_album_track": ["year"], "movie_show_season_episode_album_track": ["year"],
"movie_show_episode_artist_track": ["filepath"], "movie_show_episode_artist_track": ["filepath"],
"movie_show_episode_album": ["release", "critic_rating", "history"], "movie_show_episode_album": ["release", "critic_rating", "history"],
@ -134,7 +134,7 @@ filters = {
"track": [item for check, sub in filters_by_type.items() for item in sub if "track" in check] "track": [item for check, sub in filters_by_type.items() for item in sub if "track" in check]
} }
tmdb_filters = ["original_language", "tmdb_vote_count", "tmdb_year", "first_episode_aired", "last_episode_aired"] tmdb_filters = ["original_language", "tmdb_vote_count", "tmdb_year", "first_episode_aired", "last_episode_aired"]
string_filters = ["title", "studio", "record_label", "filepath", "audio_track_title"] string_filters = ["title", "summary", "studio", "record_label", "filepath", "audio_track_title"]
string_modifiers = ["", ".not", ".is", ".isnot", ".begins", ".ends", ".regex"] string_modifiers = ["", ".not", ".is", ".isnot", ".begins", ".ends", ".regex"]
tag_filters = [ tag_filters = [
"actor", "collection", "content_rating", "country", "director", "network", "genre", "label", "producer", "year", "actor", "collection", "content_rating", "country", "director", "network", "genre", "label", "producer", "year",
@ -1616,7 +1616,7 @@ class CollectionBuilder:
else: else:
logger.error(err) logger.error(err)
return valid_regex return valid_regex
elif attribute in plex.string_attributes + ["audio_track_title"] and modifier in ["", ".not", ".is", ".isnot", ".begins", ".ends"]: elif attribute in plex.string_attributes + string_filters and modifier in ["", ".not", ".is", ".isnot", ".begins", ".ends"]:
return smart_pair(util.get_list(data, split=False)) return smart_pair(util.get_list(data, split=False))
elif attribute == "original_language": elif attribute == "original_language":
return util.get_list(data, lower=True) return util.get_list(data, lower=True)
@ -1856,10 +1856,10 @@ class CollectionBuilder:
continue continue
if filter_attr not in filters[item_type]: if filter_attr not in filters[item_type]:
continue continue
elif filter_attr in ["release", "added", "last_played"]: elif filter_attr in date_filters:
if util.is_date_filter(getattr(item, filter_actual), modifier, filter_data, filter_final, self.current_time): if util.is_date_filter(getattr(item, filter_actual), modifier, filter_data, filter_final, self.current_time):
return False return False
elif filter_attr in ["audio_track_title", "filepath", "title", "studio"]: elif filter_attr in string_filters:
values = [] values = []
if filter_attr == "audio_track_title": if filter_attr == "audio_track_title":
for media in item.media: for media in item.media:
@ -1867,7 +1867,7 @@ class CollectionBuilder:
values.extend([a.title for a in part.audioStreams() if a.title]) values.extend([a.title for a in part.audioStreams() if a.title])
elif filter_attr == "filepath": elif filter_attr == "filepath":
values = [loc for loc in item.locations] values = [loc for loc in item.locations]
elif filter_attr in ["title", "studio"]: else:
values = [getattr(item, filter_actual)] values = [getattr(item, filter_actual)]
if util.is_string_filter(values, modifier, filter_data): if util.is_string_filter(values, modifier, filter_data):
return False return False

Loading…
Cancel
Save