Skip to content

Commit

Permalink
Jellyfin/Emby: Fix missing locations
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi311 committed Feb 19, 2025
1 parent 3a121b7 commit a0d0962
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/jellyfin_emby.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit a0d0962

Please sign in to comment.