[7] more overlay tweaks

This commit is contained in:
meisnate12 2022-04-19 18:21:05 -04:00
parent 1d06d5c4df
commit de645d905a
4 changed files with 40 additions and 38 deletions

View file

@ -1 +1 @@
1.16.5-develop6
1.16.5-develop7

View file

@ -781,11 +781,11 @@ class ConfigFile:
continue
logger.info("")
logger.separator("Scanning Metadata Files", space=False, border=False)
logger.separator("Scanning Metadata and Overlay Files", space=False, border=False)
library.scan_files()
if not library.metadata_files and not library.library_operation and not self.playlist_files:
logger.info("")
logger.error("Config Error: No valid metadata files, playlist files, or library operations found")
logger.error("Config Error: No valid metadata files, overlay files, playlist files, or library operations found")
continue
if self.general["radarr"]["url"] or (lib and "radarr" in lib):

View file

@ -24,9 +24,14 @@ class Overlays:
overlay_updated = {}
overlay_images = {}
item_overlays = {}
if not self.library.remove_overlays:
if self.library.remove_overlays:
logger.info("")
logger.separator(f"Removing Overlays for the {self.library.name} Library")
logger.info("")
else:
for overlay_file in self.library.overlay_files:
for k, v in overlay_file.overlays.items():
try:
builder = CollectionBuilder(self.config, overlay_file, k, v, library=self.library, overlay=True)
logger.info("")
@ -58,6 +63,8 @@ class Overlays:
for remove_overlay in builder.remove_overlays:
if remove_overlay in overlay_rating_keys and rk in overlay_rating_keys[remove_overlay]:
overlay_rating_keys[remove_overlay].remove(rk)
except Failed as e:
logger.error(e)
for overlay_name, over_keys in overlay_rating_keys.items():
clean_name, _ = util.validate_filename(overlay_name)
@ -99,11 +106,6 @@ class Overlays:
elif self.library.is_music:
remove_overlays.extend(get_overlay_items(libtype="album"))
if remove_overlays:
logger.info("")
logger.separator(f"Removing Overlays for the {self.library.name} Library")
logger.info("")
for i, item in enumerate(remove_overlays, 1):
logger.ghost(f"Restoring: {i}/{len(remove_overlays)} {item.title}")
clean_name, _ = util.validate_filename(item.title)

View file

@ -223,7 +223,7 @@ def update_libraries(config):
if config.library_first and not config.test_mode and not collection_only:
if not overlays_only and library.library_operation:
library.Operations.run_operations()
if not operations_only and library.overlay_files or library.remove_overlays:
if not operations_only and (library.overlay_files or library.remove_overlays):
library.Overlays.run_overlays()
logger.debug("")