From 1e344ae3fefe9de3a20c98f67d49f35d52c5dec7 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Thu, 3 Mar 2022 10:11:36 -0500 Subject: [PATCH] [88] #744 catch the error as well --- VERSION | 2 +- plex_meta_manager.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index da080adb..dd610098 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.15.1-develop87 +1.15.1-develop88 diff --git a/plex_meta_manager.py b/plex_meta_manager.py index 3bc68fc9..d6c29fde 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -433,12 +433,16 @@ def library_operations(config, library): num_edited = 0 for i, item in enumerate(tracks, 1): logger.ghost(f"Processing Track: {i}/{len(tracks)} {item.title}") - if not hasattr(item, "title") or not hasattr(item, "titleSort"): - item.refresh() - elif not item.title and item.sortTitle: - library.edit_query(item, {"title.locked": 1, "title.value": item.sortTitle}) - num_edited += 1 - logger.info(f"Track: {item.sortTitle} was updated with sort title") + try: + if not hasattr(item, "title") or not hasattr(item, "titleSort"): + item.refresh() + raise Failed(f"Track attributes not found refreshing metadata for {item.ratingKey}") + if not item.title and item.sortTitle: + library.edit_query(item, {"title.locked": 1, "title.value": item.sortTitle}) + num_edited += 1 + logger.info(f"Track: {item.sortTitle} was updated with sort title") + except Failed as e: + logger.error(e) logger.info(f"{len(tracks)} Tracks Processed; {num_edited} Blank Track Titles Updated") tmdb_collections = {}