[66] fix asset_depth

This commit is contained in:
meisnate12 2022-05-05 12:29:49 -04:00
parent 54c7581bf8
commit 7b32bdcb86
4 changed files with 12 additions and 10 deletions

View file

@ -1 +1 @@
1.16.5-develop65 1.16.5-develop66

View file

@ -881,7 +881,7 @@ class Plex(Library):
if asset_directory is None: if asset_directory is None:
asset_directory = self.asset_directory 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): if isinstance(item, Album):
prefix = f"{item.title} Album {item.title}'s " prefix = f"{item.title} Album {item.title}'s "
file_name = item.title file_name = item.title
@ -892,7 +892,7 @@ class Plex(Library):
prefix = f"{item.title} {item.seasonEpisode.upper()}'s " prefix = f"{item.title} {item.seasonEpisode.upper()}'s "
file_name = item.seasonEpisode.upper() file_name = item.seasonEpisode.upper()
else: 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" file_name = "poster"
if not item_asset_directory: if not item_asset_directory:
@ -922,6 +922,7 @@ class Plex(Library):
matches = util.glob_filter(os.path.join(new_path, folder_name)) matches = util.glob_filter(os.path.join(new_path, folder_name))
if len(matches) > 0: if len(matches) > 0:
item_asset_directory = os.path.abspath(matches[0]) item_asset_directory = os.path.abspath(matches[0])
break
else: else:
matches = util.glob_filter(os.path.join(ad, f"{file_name}.*")) matches = util.glob_filter(os.path.join(ad, f"{file_name}.*"))
if len(matches) > 0: if len(matches) > 0:

View file

@ -159,7 +159,7 @@ class Webhooks:
if "error" in json: if "error" in json:
title = f":warning: Plex Meta Manager Encountered {'a Critical' if json['critical'] else 'an'} Error" title = f":warning: Plex Meta Manager Encountered {'a Critical' if json['critical'] else 'an'} Error"
rows.append([]) rows.append([])
rows.append([(json["notes"], )]) rows.append([(json["error"], )])
else: else:
if json["deleted"]: if json["deleted"]:
title = f":heavy_minus_sign: A {text} has Been Deleted!" title = f":heavy_minus_sign: A {text} has Been Deleted!"
@ -249,7 +249,7 @@ class Webhooks:
rows.append(row1) rows.append(row1)
if "error" in json: if "error" in json:
title = f"{'Critical ' if json['critical'] else ''}Error" title = f"{'Critical ' if json['critical'] else ''}Error"
rows.append([("Error Message", json["notes"])]) rows.append([("Error Message", json["error"])])
else: else:
if json["deleted"]: if json["deleted"]:
title = f"{text} Deleted" title = f"{text} Deleted"

View file

@ -402,10 +402,10 @@ def update_libraries(config):
def print_status( status): def print_status( status):
logger.info(f"{'Title':^{longest}} | + | = | - | Run Time | {'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}|" 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) logger.separator(breaker, space=False, border=False, side_space=False, left=True)
for name, data in status.items(): 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"]: if data["errors"]:
for error in data["errors"]: for error in data["errors"]:
logger.info(error) logger.info(error)
@ -416,9 +416,10 @@ def update_libraries(config):
logger.info("") logger.info("")
logger.separator(f"{library.name} Summary", space=False, border=False) logger.separator(f"{library.name} Summary", space=False, border=False)
logger.info("") 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(): 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("") logger.info("")
print_status(library.status) print_status(library.status)
if playlist_status: if playlist_status: