From af2259a43cd41c7fea99d2f3a9c6d63434387b68 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Fri, 12 Feb 2021 23:28:46 -0500 Subject: [PATCH] added show_filtered --- modules/config.py | 6 ++++++ modules/plex.py | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/config.py b/modules/config.py index c7910b1a..57facf2b 100644 --- a/modules/config.py +++ b/modules/config.py @@ -428,6 +428,7 @@ class Config: backgrounds_found = [] collectionless = "plex_collectionless" in collections[c] skip_collection = True + show_filtered = False if "schedule" not in collections[c]: skip_collection = False @@ -581,6 +582,9 @@ class Config: elif method_name == "add_to_arr": if isinstance(collections[c][m], bool): details[method_name] = collections[c][m] else: raise Failed("Collection Error: add_to_arr must be either true or false") + elif method_name == "show_filtered": + if isinstance(collections[c][m], bool): show_filtered = collections[c][m] + else: raise Failed("Collection Error: show_filtered must be either true or false using the default false") elif method_name in util.all_details: details[method_name] = collections[c][m] elif method_name in ["year", "year.not"]: methods.append(("plex_search", [[(method_name, util.get_year_list(collections[c][m], method_name))]])) elif method_name in ["decade", "decade.not"]: methods.append(("plex_search", [[(method_name, util.get_int_list(collections[c][m], util.remove_not(method_name)))]])) @@ -964,6 +968,8 @@ class Config: title = str(movie.title) missing_movies_with_names.append((title, missing_id)) logger.info("{} Collection | ? | {} (TMDb: {})".format(collection_name, title, missing_id)) + elif show_filtered is True: + logger.info("{} Collection | X | {} (TMDb: {})".format(collection_name, title, missing_id)) except Failed as e: logger.error(e) logger.info("{} Movie{} Missing".format(len(missing_movies_with_names), "s" if len(missing_movies_with_names) > 1 else "")) diff --git a/modules/plex.py b/modules/plex.py index 75bc876d..66d2afc0 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -162,7 +162,7 @@ class PlexAPI: except yaml.scanner.ScannerError as e: logger.error("YAML Error: {}".format(str(e).replace("\n", "\n|\t "))) - def add_to_collection(self, collection, items, filters, map, movie_map, show_map): + def add_to_collection(self, collection, items, filters, show_filtered, map, movie_map, show_map): name = collection.title if isinstance(collection, Collections) else collection collection_items = collection.items() if isinstance(collection, Collections) else [] total = len(items) @@ -231,6 +231,8 @@ class PlexAPI: util.print_end(length, "{} Collection | {} | {}".format(name, "=" if current in collection_items else "+", current.title)) if current in collection_items: map[current.ratingKey] = None else: current.addCollection(name) + elif show_filtered is True: + logger.info("{} Collection | X | {}".format(name, current.title)) media_type = "{}{}".format("Movie" if self.is_movie else "Show", "s" if total > 1 else "") util.print_end(length, "{} {} Processed".format(total, media_type)) return map