Skip to content

Commit

Permalink
Add username to changes from scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiRigal committed Apr 29, 2022
1 parent 5f0fd7e commit 200f501
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,11 @@ def scheduler_callback(self):
min_date = datetime.now() - timedelta(days=1)
history = self.plex.history(mindate=min_date)
for episode in [media for media in history if isinstance(media, Episode)]:
user = PlexUtils.get_user_from_user_id(self.plex, episode.accountID)
if user is None:
continue
episode.reload()
self.change_default_tracks_if_needed(None, episode)
self.change_default_tracks_if_needed(user.name, episode)

def change_default_tracks_if_needed(self, username: str, episode: Episode, episodes: List[Episode] = None):
logger.debug(f"[Language Update] "
Expand Down

0 comments on commit 200f501

Please sign in to comment.