Merge pull request #93 from luigi311/dev

pull/94/head
Luigi311 2023-07-19 12:07:40 -06:00 committed by GitHub
commit e4dbd8adfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -35,6 +35,8 @@ def get_movie_guids(movie):
movie_guids["locations"] = tuple(
[x["Path"].split("/")[-1] for x in movie["MediaSources"]]
)
else:
movie_guids["locations"] = tuple()
movie_guids["status"] = {
"completed": movie["UserData"]["Played"],
@ -50,11 +52,11 @@ def get_episode_guids(episode):
episode_dict = {k.lower(): v for k, v in episode["ProviderIds"].items()}
episode_dict["title"] = episode["Name"]
episode_dict["locations"] = (
tuple([x["Path"].split("/")[-1] for x in ["MediaSources"] if "Path" in x])
if "MediaSources" in episode
else tuple()
)
episode_dict["locations"] = tuple()
if "MediaSources" in episode:
for x in episode["MediaSources"]:
if "Path" in x:
episode_dict["locations"] += (x["Path"].split("/")[-1],)
episode_dict["status"] = {
"completed": episode["UserData"]["Played"],