From 51ec69f651c6702fd5427c8ec75273a8cd2d1e0c Mon Sep 17 00:00:00 2001 From: Luis Garcia Date: Sat, 9 Nov 2024 13:44:22 -0700 Subject: [PATCH] Simplify search_mapping Signed-off-by: Luis Garcia --- src/plex.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/plex.py b/src/plex.py index 77b06da..32ffe66 100644 --- a/src/plex.py +++ b/src/plex.py @@ -545,10 +545,7 @@ class Plex: 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 = ( @@ -591,10 +588,7 @@ class Plex: 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()