From 280de290b24a318d6a7c641ed7a8594a215ad6ab Mon Sep 17 00:00:00 2001 From: Luis Garcia Date: Sun, 27 Oct 2024 17:43:17 -0600 Subject: [PATCH] Fix Jellyfin_Emby bug --- src/jellyfin_emby.py | 13 +++++++------ src/plex.py | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/jellyfin_emby.py b/src/jellyfin_emby.py index 83727d7..11b76f3 100644 --- a/src/jellyfin_emby.py +++ b/src/jellyfin_emby.py @@ -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( @@ -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, @@ -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( [ @@ -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) diff --git a/src/plex.py b/src/plex.py index 490a4e4..7e95f7c 100644 --- a/src/plex.py +++ b/src/plex.py @@ -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, )