From 7b32bdcb86928c5e9a9e6ea2269a75a9e2d3c908 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Thu, 5 May 2022 12:29:49 -0400 Subject: [PATCH] [66] fix asset_depth --- VERSION | 2 +- modules/plex.py | 5 +++-- modules/webhooks.py | 4 ++-- plex_meta_manager.py | 11 ++++++----- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 74da94ac..e2bfaec4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.5-develop65 +1.16.5-develop66 diff --git a/modules/plex.py b/modules/plex.py index 0045c460..0fb8fd51 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -881,7 +881,7 @@ class Plex(Library): if asset_directory is None: asset_directory = self.asset_directory - is_top_level = isinstance(item, (Movie, Artist, Show, Collection, Playlist)) + is_top_level = isinstance(item, (Movie, Artist, Show, Collection, Playlist, str)) if isinstance(item, Album): prefix = f"{item.title} Album {item.title}'s " file_name = item.title @@ -892,7 +892,7 @@ class Plex(Library): prefix = f"{item.title} {item.seasonEpisode.upper()}'s " file_name = item.seasonEpisode.upper() else: - prefix = f"{item.title if is_top_level else item}'s " + prefix = f"{item if isinstance(item, str) else item.title}'s " file_name = "poster" if not item_asset_directory: @@ -922,6 +922,7 @@ class Plex(Library): matches = util.glob_filter(os.path.join(new_path, folder_name)) if len(matches) > 0: item_asset_directory = os.path.abspath(matches[0]) + break else: matches = util.glob_filter(os.path.join(ad, f"{file_name}.*")) if len(matches) > 0: diff --git a/modules/webhooks.py b/modules/webhooks.py index 7f340143..9c4736a8 100644 --- a/modules/webhooks.py +++ b/modules/webhooks.py @@ -159,7 +159,7 @@ class Webhooks: if "error" in json: title = f":warning: Plex Meta Manager Encountered {'a Critical' if json['critical'] else 'an'} Error" rows.append([]) - rows.append([(json["notes"], )]) + rows.append([(json["error"], )]) else: if json["deleted"]: title = f":heavy_minus_sign: A {text} has Been Deleted!" @@ -249,7 +249,7 @@ class Webhooks: rows.append(row1) if "error" in json: title = f"{'Critical ' if json['critical'] else ''}Error" - rows.append([("Error Message", json["notes"])]) + rows.append([("Error Message", json["error"])]) else: if json["deleted"]: title = f"{text} Deleted" diff --git a/plex_meta_manager.py b/plex_meta_manager.py index 9d95fa89..7cae07b4 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -401,11 +401,11 @@ def update_libraries(config): longest = len(title) def print_status( status): - logger.info(f"{'Title':^{longest}} | + | = | - | Run Time | {'Status'}") - breaker = f"{logger.separating_character * longest}|{logger.separating_character * 5}|{logger.separating_character * 5}|{logger.separating_character * 5}|" + logger.info(f"{'Title':^{longest}} | + | = | - | Run Time | {'Status'}") + breaker = f"{logger.separating_character * longest}|{logger.separating_character * 7}|{logger.separating_character * 7}|{logger.separating_character * 7}|{logger.separating_character * 10}|" logger.separator(breaker, space=False, border=False, side_space=False, left=True) for name, data in status.items(): - logger.info(f"{name:<{longest}} | {data['added']:^3} | {data['unchanged']:^3} | {data['removed']:^3} | {data['run_time']:>8} | {data['status']}") + logger.info(f"{name:<{longest}} | {data['added']:>5} | {data['unchanged']:>5} | {data['removed']:>5} | {data['run_time']:>8} | {data['status']}") if data["errors"]: for error in data["errors"]: logger.info(error) @@ -416,9 +416,10 @@ def update_libraries(config): logger.info("") logger.separator(f"{library.name} Summary", space=False, border=False) logger.info("") - logger.info(f"{'Title':<27} | Run Time") + logger.info(f"{'Title':<27} | Run Time |") + logger.separator(f"{logger.separating_character * 27}|{logger.separating_character * 10}|", space=False, border=False, side_space=False, left=True) for text, value in library_status[library.name].items(): - logger.info(f"{text:<27} | {value:>8}") + logger.info(f"{text:<27} | {value:>8} |") logger.info("") print_status(library.status) if playlist_status: