From f9b149c7c8a99954cd8c0fa33d710240d9f1cb0f Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Tue, 20 Dec 2022 16:29:00 -0500 Subject: [PATCH] [69] fix resolution default --- VERSION | 2 +- modules/library.py | 2 -- modules/meta.py | 3 ++- modules/overlay.py | 17 +++++------------ modules/overlays.py | 13 ++++++------- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/VERSION b/VERSION index 853cb28c..28ce0e1f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.0-develop68 +1.18.0-develop69 diff --git a/modules/library.py b/modules/library.py index 3e6cca08..24fbbdab 100644 --- a/modules/library.py +++ b/modules/library.py @@ -22,7 +22,6 @@ class Library(ABC): self.queue_current = 0 self.metadata_files = [] self.overlay_files = [] - self.overlay_names = [] self.movie_map = {} self.show_map = {} self.imdb_map = {} @@ -32,7 +31,6 @@ class Library(ABC): self.show_rating_key_map = {} self.cached_items = {} self.run_again = [] - self.overlays_old = [] self.type = "" self.config = config self.name = params["name"] diff --git a/modules/meta.py b/modules/meta.py index fd677bbc..4607adf8 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -1565,8 +1565,9 @@ class OverlayFile(DataFile): super().__init__(config, file_type, path, temp_vars, asset_directory) self.library = library self.data_type = "Overlay" + self.file_num = len(library.overlay_files) logger.info("") - logger.info(f"Loading Overlay {file_type}: {path}") + logger.info(f"Loading Overlay {self.file_num} {file_type}: {path}") logger.debug("") data = self.load_file(self.type, self.path, overlay=True) self.overlays = get_dict("overlays", data) diff --git a/modules/overlay.py b/modules/overlay.py index 51041a3e..1b4229dc 100644 --- a/modules/overlay.py +++ b/modules/overlay.py @@ -70,7 +70,6 @@ class Overlay: self.overlay_file = overlay_file self.original_mapping_name = original_mapping_name self.data = overlay_data - self.suppress = suppress self.level = level self.keys = [] self.updated = False @@ -107,17 +106,11 @@ class Overlay: if "name" not in self.data or not self.data["name"]: raise Failed(f"Overlay Error: overlay must have the name attribute") self.name = str(self.data["name"]) - if self.original_mapping_name not in library.overlay_names: - library.overlay_names.append(self.original_mapping_name) - self.mapping_name = self.original_mapping_name - else: - name_count = 1 - test_name = f"{self.original_mapping_name} ({name_count})" - while test_name in library.overlay_names: - name_count += 1 - test_name = f"{self.original_mapping_name} ({name_count})" - library.overlay_names.append(test_name) - self.mapping_name = test_name + + self.prefix = f"Overlay File ({self.overlay_file.file_num}) " + + self.mapping_name = f"{self.prefix}{self.original_mapping_name}" + self.suppress = [f"{self.prefix}{s}" for s in suppress] if "group" in self.data and self.data["group"]: self.group = str(self.data["group"]) diff --git a/modules/overlays.py b/modules/overlays.py index d782182e..5d4dde06 100644 --- a/modules/overlays.py +++ b/modules/overlays.py @@ -379,9 +379,8 @@ class Overlays: logger.separator(f"Gathering Items for {k} Overlay", space=False, border=False) - if builder.overlay.mapping_name in properties: - raise Failed(f"Overlay Error: Overlay {builder.overlay.mapping_name} already exists") - properties[builder.overlay.mapping_name] = builder.overlay + prop_name = builder.overlay.mapping_name + properties[prop_name] = builder.overlay builder.display_filters() @@ -403,13 +402,13 @@ class Overlays: for item in builder.found_items: key_to_item[item.ratingKey] = item added_titles.append(item) - if item.ratingKey not in properties[builder.overlay.mapping_name].keys: - properties[builder.overlay.mapping_name].keys.append(item.ratingKey) + if item.ratingKey not in properties[prop_name].keys: + properties[prop_name].keys.append(item.ratingKey) if added_titles: - logger.info(f"{len(added_titles)} Items found for {builder.overlay.mapping_name} Overlay") + logger.info(f"{len(added_titles)} Items found for {prop_name}") logger.trace(f"Titles Found: {[self.library.get_item_sort_title(a, atr='title') for a in added_titles]}") else: - logger.warning(f"No Items found for {builder.overlay.mapping_name} Overlay") + logger.warning(f"No Items found for {prop_name}") logger.info("") except NotScheduled as e: logger.info(e)