diff --git a/modules/builder.py b/modules/builder.py index c7fabf6e..b53ab89b 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -119,6 +119,7 @@ all_filters = [ "content_rating", "content_rating.not", "country", "country.not", "director", "director.not", + "filepath", "filepath.not", "genre", "genre.not", "max_age", "originally_available.gte", "originally_available.lte", @@ -634,9 +635,9 @@ class CollectionBuilder: valid_data = util.check_number(filter_data, f"{filter_method} filter", number_type="float", minimum=0.1, maximum=10) elif filter_method in ["originally_available.gte", "originally_available.lte"]: valid_data = util.check_date(filter_data, f"{filter_method} filter") - elif filter_method == "original_language": + elif filter_method in ["original_language", "original_language.not"]: valid_data = util.get_list(filter_data, lower=True) - elif filter_method == "collection": + elif filter_method in ["collection", "collection.not"]: valid_data = filter_data if isinstance(filter_data, list) else [filter_data] elif filter_method in all_filters: valid_data = util.get_list(filter_data) diff --git a/modules/plex.py b/modules/plex.py index c9a4e400..41ba1f9f 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -441,6 +441,17 @@ class PlexAPI: if (jailbreak and modifier == ".not") or (not jailbreak and modifier != ".not"): match = False break + elif method_name == "filepath": + jailbreak = False + for location in current.locations: + for location_prefix in filter_data: + if location.startswith(location_prefix): + jailbreak = True + break + if jailbreak: break + if (jailbreak and modifier == ".not") or (not jailbreak and modifier != ".not"): + match = False + break elif modifier in [".gte", ".lte"]: if method_name == "vote_count": tmdb_item = None