From c542d3026c19ca26b18d1b488d8a951ce83306b0 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 1 Dec 2021 11:59:49 -0500 Subject: [PATCH] added only_filter_missing collection detail --- modules/builder.py | 5 +++-- modules/config.py | 2 ++ modules/library.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/builder.py b/modules/builder.py index 50171f6b..ae814a46 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -80,7 +80,7 @@ poster_details = ["url_poster", "tmdb_poster", "tmdb_profile", "tvdb_poster", "f background_details = ["url_background", "tmdb_background", "tvdb_background", "file_background"] boolean_details = [ "visible_library", "visible_home", "visible_shared", "show_filtered", "show_missing", "save_missing", - "missing_only_released", "delete_below_minimum" + "missing_only_released", "only_filter_missing", "delete_below_minimum" ] string_details = ["sort_title", "content_rating", "name_mapping"] ignored_details = [ @@ -178,6 +178,7 @@ class CollectionBuilder: "show_missing": self.library.show_missing, "save_missing": self.library.save_missing, "missing_only_released": self.library.missing_only_released, + "only_filter_missing": self.library.only_filter_missing, "create_asset_folders": self.library.create_asset_folders, "delete_below_minimum": self.library.delete_below_minimum, "collection_creation_webhooks": self.library.collection_creation_webhooks, @@ -1641,7 +1642,7 @@ class CollectionBuilder: return True def check_filters(self, current, display): - if self.filters or self.tmdb_filters: + if (self.filters or self.tmdb_filters) and not self.details["only_filter_missing"]: util.print_return(f"Filtering {display} {current.title}") if self.tmdb_filters: if current.ratingKey not in self.library.movie_rating_key_map and current.ratingKey not in self.library.show_rating_key_map: diff --git a/modules/config.py b/modules/config.py index b855f9e5..3fa2cd5e 100644 --- a/modules/config.py +++ b/modules/config.py @@ -193,6 +193,7 @@ class Config: "show_missing_assets": check_for_attribute(self.data, "show_missing_assets", parent="settings", var_type="bool", default=True), "save_missing": check_for_attribute(self.data, "save_missing", parent="settings", var_type="bool", default=True), "missing_only_released": check_for_attribute(self.data, "missing_only_released", parent="settings", var_type="bool", default=False), + "only_filter_missing": check_for_attribute(self.data, "only_filter_missing", parent="settings", var_type="bool", default=False), "create_asset_folders": check_for_attribute(self.data, "create_asset_folders", parent="settings", var_type="bool", default=False), "collection_minimum": check_for_attribute(self.data, "collection_minimum", parent="settings", var_type="int", default=1), "delete_below_minimum": check_for_attribute(self.data, "delete_below_minimum", parent="settings", var_type="bool", default=False), @@ -408,6 +409,7 @@ class Config: params["show_missing_assets"] = check_for_attribute(lib, "show_missing_assets", parent="settings", var_type="bool", default=self.general["show_missing_assets"], do_print=False, save=False) params["save_missing"] = check_for_attribute(lib, "save_missing", parent="settings", var_type="bool", default=self.general["save_missing"], do_print=False, save=False) params["missing_only_released"] = check_for_attribute(lib, "missing_only_released", parent="settings", var_type="bool", default=self.general["missing_only_released"], do_print=False, save=False) + params["only_filter_missing"] = check_for_attribute(lib, "only_filter_missing", parent="settings", var_type="bool", default=self.general["only_filter_missing"], do_print=False, save=False) params["create_asset_folders"] = check_for_attribute(lib, "create_asset_folders", parent="settings", var_type="bool", default=self.general["create_asset_folders"], do_print=False, save=False) params["collection_minimum"] = check_for_attribute(lib, "collection_minimum", parent="settings", var_type="int", default=self.general["collection_minimum"], do_print=False, save=False) params["delete_below_minimum"] = check_for_attribute(lib, "delete_below_minimum", parent="settings", var_type="bool", default=self.general["delete_below_minimum"], do_print=False, save=False) diff --git a/modules/library.py b/modules/library.py index 4f3854a5..fede7691 100644 --- a/modules/library.py +++ b/modules/library.py @@ -47,6 +47,7 @@ class Library(ABC): self.show_missing_assets = params["show_missing_assets"] self.save_missing = params["save_missing"] self.missing_only_released = params["missing_only_released"] + self.only_filter_missing = params["only_filter_missing"] self.create_asset_folders = params["create_asset_folders"] self.assets_for_all = params["assets_for_all"] self.delete_unmanaged_collections = params["delete_unmanaged_collections"]