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):
return {
"title": item.title,
"locations": tuple([location.split("/")[-1] for location in item.locations])
if generate_locations
else tuple(),
"locations": (
tuple([location.split("/")[-1] for location in item.locations])
if generate_locations
else tuple()
),
"status": {
"completed": completed,
"time": item.viewOffset,
@@ -84,11 +86,11 @@ def get_user_library_watched_show(show, process_episodes, threads=None):
(
{
"title": show.title,
"locations": tuple(
[location.split("/")[-1] for location in show.locations]
)
if generate_locations
else tuple(),
"locations": (
tuple([location.split("/")[-1] for location in show.locations])
if generate_locations
else tuple()
),
}
| extract_guids_from_item(show)
).items() # Merge the metadata and guid dictionaries