diff --git a/VERSION b/VERSION index 0ecc9bc9..2ede906c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.15.1-develop72 +1.15.1-develop73 diff --git a/modules/library.py b/modules/library.py index 0eea0598..473efaf7 100644 --- a/modules/library.py +++ b/modules/library.py @@ -89,7 +89,7 @@ class Library(ABC): self.clean_bundles = params["plex"]["clean_bundles"] # TODO: Here or just in Plex? self.empty_trash = params["plex"]["empty_trash"] # TODO: Here or just in Plex? self.optimize = params["plex"]["optimize"] # TODO: Here or just in Plex? - self.stats = {"created": 0, "modified": 0, "deleted": 0, "added": 0, "unchanged": 0, "removed": 0, "radarr": 0, "sonarr": 0} + self.stats = {"created": 0, "modified": 0, "deleted": 0, "added": 0, "unchanged": 0, "removed": 0, "radarr": 0, "sonarr": 0, "names": []} self.status = {} self.items_library_operation = True if self.assets_for_all or self.mass_genre_update or self.mass_audience_rating_update \ diff --git a/modules/logs.py b/modules/logs.py index f6c8b765..b386a4ea 100644 --- a/modules/logs.py +++ b/modules/logs.py @@ -58,7 +58,6 @@ class MyLogger: def _get_handler(self, log_file, count=3): _handler = RotatingFileHandler(log_file, delay=True, mode="w", backupCount=count, encoding="utf-8") self._formatter(_handler) - _handler.addFilter(fmt_filter) if os.path.isfile(log_file): _handler.doRollover() return _handler @@ -71,6 +70,7 @@ class MyLogger: def add_main_handler(self): self.main_handler = self._get_handler(self.main_log, count=10) + self.main_handler.addFilter(fmt_filter) self._logger.addHandler(self.main_handler) def remove_main_handler(self): diff --git a/modules/webhooks.py b/modules/webhooks.py index a0530ef3..4aacf518 100644 --- a/modules/webhooks.py +++ b/modules/webhooks.py @@ -61,6 +61,7 @@ class Webhooks: "items_removed": stats["removed"], "added_to_radarr": stats["radarr"], "added_to_sonarr": stats["sonarr"], + "names": stats["names"] }) def error_hooks(self, text, server=None, library=None, collection=None, playlist=None, critical=True): diff --git a/plex_meta_manager.py b/plex_meta_manager.py index 82765951..5fd4219a 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -372,7 +372,7 @@ def update_libraries(config): if playlist_status: print_status("Playlists", playlist_status) - stats = {"created": 0, "modified": 0, "deleted": 0, "added": 0, "unchanged": 0, "removed": 0, "radarr": 0, "sonarr": 0} + stats = {"created": 0, "modified": 0, "deleted": 0, "added": 0, "unchanged": 0, "removed": 0, "radarr": 0, "sonarr": 0, "names": []} stats["added"] += amount_added for library in config.libraries: stats["created"] += library.stats["created"] @@ -383,6 +383,7 @@ def update_libraries(config): stats["removed"] += library.stats["removed"] stats["radarr"] += library.stats["radarr"] stats["sonarr"] += library.stats["sonarr"] + stats["names"].extend([{"name": n, "library": library.name} for n in library.stats["names"]]) if playlist_stats: stats["created"] += playlist_stats["created"] stats["modified"] += playlist_stats["modified"] @@ -392,7 +393,7 @@ def update_libraries(config): stats["removed"] += playlist_stats["removed"] stats["radarr"] += playlist_stats["radarr"] stats["sonarr"] += playlist_stats["sonarr"] - + stats["names"].extend([{"name": n, "library": "PLAYLIST"} for n in playlist_stats["names"]]) return stats def library_operations(config, library): @@ -807,6 +808,7 @@ def run_collection(config, library, metadata, requested_collections): logger.separator(f"Validating {mapping_name} Attributes", space=False, border=False) builder = CollectionBuilder(config, metadata, mapping_name, no_missing, collection_attrs, library=library) + library.stats["names"].append(builder.name) logger.info("") logger.separator(f"Running {mapping_name} Collection", space=False, border=False) @@ -938,7 +940,7 @@ def run_collection(config, library, metadata, requested_collections): logger.remove_collection_handler(library.mapping_name, collection_log_name) def run_playlists(config): - stats = {"created": 0, "modified": 0, "deleted": 0, "added": 0, "unchanged": 0, "removed": 0, "radarr": 0, "sonarr": 0} + stats = {"created": 0, "modified": 0, "deleted": 0, "added": 0, "unchanged": 0, "removed": 0, "radarr": 0, "sonarr": 0, "names": []} status = {} logger.info("") logger.separator("Playlists") @@ -979,6 +981,7 @@ def run_playlists(config): logger.separator(f"Validating {mapping_name} Attributes", space=False, border=False) builder = CollectionBuilder(config, playlist_file, mapping_name, no_missing, playlist_attrs) + stats["names"].append(builder.name) logger.info("") logger.separator(f"Running {mapping_name} Playlist", space=False, border=False)