Skip to content

Commit

Permalink
Simplify search_mapping
Browse files Browse the repository at this point in the history
Signed-off-by: Luis Garcia <[email protected]>
  • Loading branch information
luigi311 committed Nov 9, 2024
1 parent 348a0b8 commit ea951da
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,7 @@ def update_watched(
user_other = None
# If type of user is dict
if user_mapping:
if user in user_mapping.keys():
user_other = user_mapping[user]
elif user in user_mapping.values():
user_other = search_mapping(user_mapping, user)
user_other = search_mapping(user_mapping, user)

for index, value in enumerate(self.users):
username_title = (
Expand Down Expand Up @@ -591,10 +588,7 @@ def update_watched(
for library, videos in libraries.items():
library_other = None
if library_mapping:
if library in library_mapping.keys():
library_other = library_mapping[library]
elif library in library_mapping.values():
library_other = search_mapping(library_mapping, library)
library_other = search_mapping(library_mapping, library)

# if library in plex library list
library_list = user_plex.library.sections()
Expand Down

0 comments on commit ea951da

Please sign in to comment.