Skip to content

Commit

Permalink
Plex: Use token, Check for token on mark
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi311 committed Mar 18, 2023
1 parent a8edee0 commit 962b114
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def get_watched(
if token:
user_plex = self.login(
self.plex._baseurl,
user.get_token(self.plex.machineIdentifier),
token,
)
else:
logger(
Expand Down Expand Up @@ -389,11 +389,19 @@ def update_watched(
)
user = self.plex.myPlexAccount().user(user)

user_plex = PlexServer(
self.plex._baseurl,
user.get_token(self.plex.machineIdentifier),
session=self.session,
)
token = user.get_token(self.plex.machineIdentifier)
if token:
user_plex = PlexServer(
self.plex._baseurl,
token,
session=self.session,
)
else:
logger(
f"Plex: Failed to get token for {user.title}, skipping",
2,
)
continue

for library, videos in libraries.items():
library_other = None
Expand Down

0 comments on commit 962b114

Please sign in to comment.