Merge pull request #90 from luigi311/dev
Fix missing paths and providers
This commit is contained in:
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@@ -25,6 +25,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: pytest
|
needs: pytest
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- dockerfile: Dockerfile.alpine
|
- dockerfile: Dockerfile.alpine
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ def setup_black_white_lists(
|
|||||||
blacklist_library,
|
blacklist_library,
|
||||||
blacklist_library_type,
|
blacklist_library_type,
|
||||||
blacklist_users,
|
blacklist_users,
|
||||||
"White",
|
"Black",
|
||||||
library_mapping,
|
library_mapping,
|
||||||
user_mapping,
|
user_mapping,
|
||||||
)
|
)
|
||||||
@@ -24,7 +24,7 @@ def setup_black_white_lists(
|
|||||||
whitelist_library,
|
whitelist_library,
|
||||||
whitelist_library_type,
|
whitelist_library_type,
|
||||||
whitelist_users,
|
whitelist_users,
|
||||||
"Black",
|
"White",
|
||||||
library_mapping,
|
library_mapping,
|
||||||
user_mapping,
|
user_mapping,
|
||||||
)
|
)
|
||||||
|
|||||||
117
src/jellyfin.py
117
src/jellyfin.py
@@ -49,8 +49,11 @@ def get_episode_guids(episode):
|
|||||||
# Create a dictionary for the episode with its provider IDs and media sources
|
# Create a dictionary for the episode with its provider IDs and media sources
|
||||||
episode_dict = {k.lower(): v for k, v in episode["ProviderIds"].items()}
|
episode_dict = {k.lower(): v for k, v in episode["ProviderIds"].items()}
|
||||||
episode_dict["title"] = episode["Name"]
|
episode_dict["title"] = episode["Name"]
|
||||||
episode_dict["locations"] = tuple(
|
|
||||||
[x["Path"].split("/")[-1] for x in episode["MediaSources"]]
|
episode_dict["locations"] = (
|
||||||
|
tuple([x["Path"].split("/")[-1] for x in ["MediaSources"] if "Path" in x])
|
||||||
|
if "MediaSources" in episode
|
||||||
|
else tuple()
|
||||||
)
|
)
|
||||||
|
|
||||||
episode_dict["status"] = {
|
episode_dict["status"] = {
|
||||||
@@ -238,7 +241,11 @@ class Jellyfin:
|
|||||||
k.lower(): v for k, v in show["ProviderIds"].items()
|
k.lower(): v for k, v in show["ProviderIds"].items()
|
||||||
}
|
}
|
||||||
show_guids["title"] = show["Name"]
|
show_guids["title"] = show["Name"]
|
||||||
show_guids["locations"] = tuple([show["Path"].split("/")[-1]])
|
show_guids["locations"] = (
|
||||||
|
tuple([show["Path"].split("/")[-1]])
|
||||||
|
if "Path" in show
|
||||||
|
else tuple()
|
||||||
|
)
|
||||||
show_guids = frozenset(show_guids.items())
|
show_guids = frozenset(show_guids.items())
|
||||||
show_identifiers = {
|
show_identifiers = {
|
||||||
"show_guids": show_guids,
|
"show_guids": show_guids,
|
||||||
@@ -550,24 +557,27 @@ class Jellyfin:
|
|||||||
|
|
||||||
if "MediaSources" in jellyfin_video:
|
if "MediaSources" in jellyfin_video:
|
||||||
for movie_location in jellyfin_video["MediaSources"]:
|
for movie_location in jellyfin_video["MediaSources"]:
|
||||||
if (
|
if "Path" in movie_location:
|
||||||
contains_nested(
|
if (
|
||||||
movie_location["Path"].split("/")[-1],
|
contains_nested(
|
||||||
videos_movies_ids["locations"],
|
movie_location["Path"].split("/")[-1],
|
||||||
)
|
videos_movies_ids["locations"],
|
||||||
is not None
|
)
|
||||||
):
|
is not None
|
||||||
for video in videos:
|
):
|
||||||
if (
|
for video in videos:
|
||||||
contains_nested(
|
if (
|
||||||
movie_location["Path"].split("/")[-1],
|
contains_nested(
|
||||||
video["locations"],
|
movie_location["Path"].split("/")[
|
||||||
)
|
-1
|
||||||
is not None
|
],
|
||||||
):
|
video["locations"],
|
||||||
movie_status = video["status"]
|
)
|
||||||
break
|
is not None
|
||||||
break
|
):
|
||||||
|
movie_status = video["status"]
|
||||||
|
break
|
||||||
|
break
|
||||||
|
|
||||||
if not movie_status:
|
if not movie_status:
|
||||||
for (
|
for (
|
||||||
@@ -697,26 +707,31 @@ class Jellyfin:
|
|||||||
for episode_location in jellyfin_episode[
|
for episode_location in jellyfin_episode[
|
||||||
"MediaSources"
|
"MediaSources"
|
||||||
]:
|
]:
|
||||||
if (
|
if "Path" in episode_location:
|
||||||
contains_nested(
|
if (
|
||||||
episode_location["Path"].split("/")[-1],
|
contains_nested(
|
||||||
videos_episodes_ids["locations"],
|
episode_location["Path"].split("/")[
|
||||||
)
|
-1
|
||||||
is not None
|
],
|
||||||
):
|
videos_episodes_ids["locations"],
|
||||||
for episode in episode_videos:
|
)
|
||||||
if (
|
is not None
|
||||||
contains_nested(
|
):
|
||||||
episode_location["Path"].split(
|
for episode in episode_videos:
|
||||||
"/"
|
if (
|
||||||
)[-1],
|
contains_nested(
|
||||||
episode["locations"],
|
episode_location[
|
||||||
)
|
"Path"
|
||||||
is not None
|
].split("/")[-1],
|
||||||
):
|
episode["locations"],
|
||||||
episode_status = episode["status"]
|
)
|
||||||
break
|
is not None
|
||||||
break
|
):
|
||||||
|
episode_status = episode[
|
||||||
|
"status"
|
||||||
|
]
|
||||||
|
break
|
||||||
|
break
|
||||||
|
|
||||||
if not episode_status:
|
if not episode_status:
|
||||||
for (
|
for (
|
||||||
@@ -735,15 +750,19 @@ class Jellyfin:
|
|||||||
):
|
):
|
||||||
for episode in episode_videos:
|
for episode in episode_videos:
|
||||||
if (
|
if (
|
||||||
episode_provider_id.lower()
|
episode_provider_source.lower()
|
||||||
in episode[
|
in episode
|
||||||
episode_provider_source.lower()
|
|
||||||
]
|
|
||||||
):
|
):
|
||||||
episode_status = episode[
|
if (
|
||||||
"status"
|
episode_provider_id.lower()
|
||||||
]
|
in episode[
|
||||||
break
|
episode_provider_source.lower()
|
||||||
|
]
|
||||||
|
):
|
||||||
|
episode_status = episode[
|
||||||
|
"status"
|
||||||
|
]
|
||||||
|
break
|
||||||
break
|
break
|
||||||
|
|
||||||
if episode_status:
|
if episode_status:
|
||||||
|
|||||||
Reference in New Issue
Block a user