Skip to content

Commit

Permalink
Fix Jellyfin_Emby bug
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi311 committed Oct 27, 2024
1 parent 4a82828 commit 280de29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/jellyfin_emby.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ def get_user_library_watched(
user_watched[library_title][show_guids] = mark_episodes_list
for episode in mark_episodes_list:
logger(
f"{self.server_type}: Added {episode} to {user_name} {show_display_name} watched list",
1,
f"{self.server_type}: Added {episode} to {user_name} watched list",
3,
)

logger(
Expand Down Expand Up @@ -431,6 +431,10 @@ def get_watched(self, users, sync_libraries):
for library in all_libraries["Items"]:
library_id = library["Id"]
library_title = library["Name"]

if library_title not in sync_libraries:
continue

identifiers = {
"library_id": library_id,
"library_title": library_title,
Expand All @@ -451,9 +455,6 @@ def get_watched(self, users, sync_libraries):
library_id = library["Identifiers"]["library_id"]
library_title = library["Identifiers"]["library_title"]

if library_title not in sync_libraries:
continue

# Get all library types excluding "Folder"
types = set(
[
Expand All @@ -473,7 +474,7 @@ def get_watched(self, users, sync_libraries):
library_title,
)

if user_name not in users_watched:
if user_name.lower() not in users_watched:
users_watched[user_name.lower()] = {}
users_watched[user_name.lower()].update(watched)

Expand Down
2 changes: 1 addition & 1 deletion src/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def get_user_library_watched(user, user_plex, library):
if show_guids and episode_guids:
watched[show_guids] = episode_guids
logger(
f"Plex: Added {episode_guids} to {user_name} {show_guids} watched list",
f"Plex: Added {episode_guids} to {user_name} watched list",
3,
)

Expand Down

0 comments on commit 280de29

Please sign in to comment.