diff --git a/VERSION b/VERSION index 1c20a861..5af9daf0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.3-develop113 +1.18.3-develop114 diff --git a/modules/config.py b/modules/config.py index fac367f6..5fb34ecc 100644 --- a/modules/config.py +++ b/modules/config.py @@ -927,8 +927,8 @@ class ConfigFile: logger.info("") logger.separator("Scanning Metadata and Overlay Files", space=False, border=False) library.scan_files(self.operations_only, self.overlays_only, self.collection_only) - if not library.metadata_files and not library.overlay_files and not library.library_operation and not self.playlist_files: - raise Failed("Config Error: No valid metadata files, overlay files, playlist files, or library operations found") + if not library.metadata_files and not library.overlay_files and not library.library_operation and not library.images_files and not self.playlist_files: + raise Failed("Config Error: No valid metadata files, overlay files, images files, playlist files, or library operations found") except Failed as e: logger.stacktrace() logger.error(e) diff --git a/modules/library.py b/modules/library.py index 64df2f8b..202bba36 100644 --- a/modules/library.py +++ b/modules/library.py @@ -4,7 +4,7 @@ from modules import util, operations from modules.meta import MetadataFile, OverlayFile from modules.operations import Operations from modules.util import Failed, NotScheduled, YAML -from PIL import Image, ImageFilter +from PIL import Image logger = util.logger @@ -23,6 +23,7 @@ class Library(ABC): self.queue_current = 0 self.metadata_files = [] self.overlay_files = [] + self.images_files = [] self.movie_map = {} self.show_map = {} self.imdb_map = {} @@ -39,6 +40,7 @@ class Library(ABC): self.original_mapping_name = params["mapping_name"] self.metadata_path = params["metadata_path"] self.overlay_path = params["overlay_path"] + self.images_path = params["images_path"] self.skip_library = params["skip_library"] self.asset_depth = params["asset_depth"] self.asset_directory = params["asset_directory"] if params["asset_directory"] else [] @@ -145,7 +147,7 @@ class Library(ABC): self.metadata_files.append(meta_obj) except Failed as e: logger.error(e) - logger.info(f"Metadata File Failed To Load") + logger.info("Metadata File Failed To Load") except NotScheduled as e: logger.info("") logger.separator(f"Skipping {e} Metadata File") @@ -159,7 +161,15 @@ class Library(ABC): self.queue_current += 1 except Failed as e: logger.error(e) - logger.info(f"Overlay File Failed To Load") + logger.info("Overlay File Failed To Load") + if not operations_only and not overlays_only: + for file_type, images_file, temp_vars, asset_directory in self.images_path: + try: + images_obj = MetadataFile(self.config, self, file_type, images_file, temp_vars, asset_directory, image_set_file=True) + self.images_files.append(images_obj) + except Failed as e: + logger.error(e) + logger.info("Images File Failed To Load") def upload_images(self, item, poster=None, background=None, overlay=False): poster_uploaded = False diff --git a/modules/meta.py b/modules/meta.py index 474e2076..657ff78f 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -587,8 +587,9 @@ class DataFile: self.translation_variables.update({k: v for k, v in variables.items() if k not in self.translation_variables}) class MetadataFile(DataFile): - def __init__(self, config, library, file_type, path, temp_vars, asset_directory): + def __init__(self, config, library, file_type, path, temp_vars, asset_directory, image_set_file=False): super().__init__(config, file_type, path, temp_vars, asset_directory) + self.image_set_file = image_set_file metadata_name = self.get_file_name() if config.requested_metadata_files and metadata_name not in config.requested_metadata_files: raise NotScheduled(metadata_name) diff --git a/plex_meta_manager.py b/plex_meta_manager.py index c3d91075..2a2832ff 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -576,6 +576,22 @@ def run_libraries(config): run_operations_and_overlays() if not operations_only and not overlays_only and not playlist_only: + time_start = datetime.now() + for images in library.images_files: + images_name = images.get_file_name() + if config.requested_metadata_files and images_name not in config.requested_metadata_files: + logger.info("") + logger.separator(f"Skipping {images_name} Images File") + continue + logger.info("") + logger.separator(f"Running {images_name} Images File\n{images.path}") + if not test and not resume and not collection_only: + try: + images.update_metadata() + except Failed as e: + library.notify(e) + logger.error(e) + time_start = datetime.now() for metadata in library.metadata_files: metadata_name = metadata.get_file_name()