Jellyfin/Emby: Log more missing identifiers information

Signed-off-by: Luis Garcia <git@luigi311.com>
pull/298/head
Luis Garcia 2025-07-14 22:53:00 +00:00
parent 629f50ecdc
commit 142c9df6e9
1 changed files with 15 additions and 12 deletions

View File

@ -40,26 +40,29 @@ def extract_identifiers_from_item(
guids = {} guids = {}
if generate_guids: if generate_guids:
guids = {k.lower(): v for k, v in item.get("ProviderIds", {}).items()} guids = {k.lower(): v for k, v in item.get("ProviderIds", {}).items()}
if not guids:
logger.debug(
f"{server_type}: {title if title else id} has no guids",
)
locations: tuple[str, ...] = tuple() locations: tuple[str, ...] = tuple()
full_path: str = ""
if generate_locations: if generate_locations:
if item.get("Path"): if item.get("Path"):
locations = tuple([item["Path"].split("/")[-1]]) full_path = item["Path"]
locations = tuple([full_path.split("/")[-1]])
elif item.get("MediaSources"): elif item.get("MediaSources"):
locations = tuple( full_paths = [x["Path"] for x in item["MediaSources"] if x.get("Path")]
[ locations = tuple([x.split("/")[-1] for x in full_paths])
x["Path"].split("/")[-1] full_path = " ".join(full_paths)
for x in item["MediaSources"]
if x.get("Path") if generate_guids:
] if not guids:
logger.debug(
f"{server_type}: {title if title else id} has no guids{f', locations: {full_path}' if full_path else ''}",
) )
if generate_locations:
if not locations: if not locations:
logger.debug(f"{server_type}: {title if title else id} has no locations") logger.debug(
f"{server_type}: {title if title else id} has no locations{f', guids: {guids}' if guids else ''}",
)
return MediaIdentifiers( return MediaIdentifiers(
title=title, title=title,