Plex: Log missing identifiers information
Signed-off-by: Luis Garcia <git@luigi311.com>
This commit is contained in:
24
src/plex.py
24
src/plex.py
@@ -65,13 +65,27 @@ def extract_identifiers_from_item(
|
|||||||
generate_locations: bool,
|
generate_locations: bool,
|
||||||
) -> MediaIdentifiers:
|
) -> MediaIdentifiers:
|
||||||
guids = extract_guids_from_item(item, generate_guids)
|
guids = extract_guids_from_item(item, generate_guids)
|
||||||
|
locations = (
|
||||||
|
tuple([location.split("/")[-1] for location in item.locations])
|
||||||
|
if generate_locations
|
||||||
|
else tuple()
|
||||||
|
)
|
||||||
|
|
||||||
|
if generate_guids:
|
||||||
|
if not guids:
|
||||||
|
logger.debug(
|
||||||
|
f"Plex: {item.title} has no guids{f', locations: {" ".join(item.locations)}' if generate_locations else ''}",
|
||||||
|
)
|
||||||
|
|
||||||
|
if generate_locations:
|
||||||
|
if not locations:
|
||||||
|
logger.debug(
|
||||||
|
f"Plex: {item.title} has no locations{f', guids: {guids}' if generate_guids else ''}",
|
||||||
|
)
|
||||||
|
|
||||||
return MediaIdentifiers(
|
return MediaIdentifiers(
|
||||||
title=item.title,
|
title=item.title,
|
||||||
locations=(
|
locations=locations,
|
||||||
tuple([location.split("/")[-1] for location in item.locations])
|
|
||||||
if generate_locations
|
|
||||||
else tuple()
|
|
||||||
),
|
|
||||||
imdb_id=guids.get("imdb"),
|
imdb_id=guids.get("imdb"),
|
||||||
tvdb_id=guids.get("tvdb"),
|
tvdb_id=guids.get("tvdb"),
|
||||||
tmdb_id=guids.get("tmdb"),
|
tmdb_id=guids.get("tmdb"),
|
||||||
|
|||||||
Reference in New Issue
Block a user