From a0d0962c864aff986af4ef954b719eb70a45a816 Mon Sep 17 00:00:00 2001 From: Luis Garcia Date: Wed, 19 Feb 2025 04:05:49 -0700 Subject: [PATCH] Jellyfin/Emby: Fix missing locations --- src/jellyfin_emby.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/jellyfin_emby.py b/src/jellyfin_emby.py index 7fde771..252f9cc 100644 --- a/src/jellyfin_emby.py +++ b/src/jellyfin_emby.py @@ -42,11 +42,13 @@ def extract_identifiers_from_item(server_type, item: dict) -> MediaIdentifiers: 1, ) - locations = ( - tuple([x["Path"].split("/")[-1] for x in item["MediaSources"] if "Path" in x]) - if "MediaSources" in item - else tuple() - ) + locations = tuple() + + if "Path" in item: + locations = tuple([item.get("Path").split("/")[-1]]) + elif "MediaSources" in item: + locations = tuple([x["Path"].split("/")[-1] for x in item["MediaSources"] if "Path" in x]) + if not locations: logger(f"{server_type}: {title if title else id} has no locations", 1) @@ -680,6 +682,8 @@ def update_watched( jellyfin_libraries = [x for x in jellyfin_libraries["Items"]] for library_name in user_data.libraries: + if library_name == "Custom TV Shows": + print("test") library_data = user_data.libraries[library_name] library_other = None if library_mapping: