Plex: format

This commit is contained in:
Luis Garcia
2024-04-14 17:06:37 -06:00
parent dcd4ac1d36
commit 402c286742

View File

@@ -66,9 +66,11 @@ def extract_guids_from_item(item: Union[Movie, Show, Episode]) -> Dict[str, str]
def get_guids(item: Union[Movie, Episode], completed=True): def get_guids(item: Union[Movie, Episode], completed=True):
return { return {
"title": item.title, "title": item.title,
"locations": tuple([location.split("/")[-1] for location in item.locations]) "locations": (
if generate_locations tuple([location.split("/")[-1] for location in item.locations])
else tuple(), if generate_locations
else tuple()
),
"status": { "status": {
"completed": completed, "completed": completed,
"time": item.viewOffset, "time": item.viewOffset,
@@ -84,11 +86,11 @@ def get_user_library_watched_show(show, process_episodes, threads=None):
( (
{ {
"title": show.title, "title": show.title,
"locations": tuple( "locations": (
[location.split("/")[-1] for location in show.locations] tuple([location.split("/")[-1] for location in show.locations])
) if generate_locations
if generate_locations else tuple()
else tuple(), ),
} }
| extract_guids_from_item(show) | extract_guids_from_item(show)
).items() # Merge the metadata and guid dictionaries ).items() # Merge the metadata and guid dictionaries