Skip to content

Commit

Permalink
Fix client identifier caching when requested too soon (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiRigal committed May 24, 2022
1 parent 7d84120 commit a3d76f0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plex_auto_languages/alerts/playing.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ def session_state(self):
def process(self, plex: PlexServer):
# Get User id and user's Plex instance
if self.client_identifier not in plex.cache.user_clients:
plex.cache.user_clients[self.client_identifier] = plex.get_user_from_client_identifier(self.client_identifier)
user_id, username = plex.cache.user_clients[self.client_identifier]
if user_id is None:
return
user_id, username = plex.get_user_from_client_identifier(self.client_identifier)
if user_id is None:
return
plex.cache.user_clients[self.client_identifier] = (user_id, username)
else:
user_id, username = plex.cache.user_clients[self.client_identifier]
user_plex = plex.get_plex_instance_of_user(user_id)
if user_plex is None:
return
Expand Down

0 comments on commit a3d76f0

Please sign in to comment.