|
|
@ -433,12 +433,16 @@ def library_operations(config, library):
|
|
|
|
num_edited = 0
|
|
|
|
num_edited = 0
|
|
|
|
for i, item in enumerate(tracks, 1):
|
|
|
|
for i, item in enumerate(tracks, 1):
|
|
|
|
logger.ghost(f"Processing Track: {i}/{len(tracks)} {item.title}")
|
|
|
|
logger.ghost(f"Processing Track: {i}/{len(tracks)} {item.title}")
|
|
|
|
|
|
|
|
try:
|
|
|
|
if not hasattr(item, "title") or not hasattr(item, "titleSort"):
|
|
|
|
if not hasattr(item, "title") or not hasattr(item, "titleSort"):
|
|
|
|
item.refresh()
|
|
|
|
item.refresh()
|
|
|
|
elif not item.title and item.sortTitle:
|
|
|
|
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})
|
|
|
|
library.edit_query(item, {"title.locked": 1, "title.value": item.sortTitle})
|
|
|
|
num_edited += 1
|
|
|
|
num_edited += 1
|
|
|
|
logger.info(f"Track: {item.sortTitle} was updated with sort title")
|
|
|
|
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")
|
|
|
|
logger.info(f"{len(tracks)} Tracks Processed; {num_edited} Blank Track Titles Updated")
|
|
|
|
|
|
|
|
|
|
|
|
tmdb_collections = {}
|
|
|
|
tmdb_collections = {}
|
|
|
|