Skip to content

Commit

Permalink
Update window title when playing/stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Aug 30, 2023
1 parent d9f861b commit b3af8f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plextraktsync/watch/WatchStateUpdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,21 @@ def scrobble(self, m: Media, percent: float, event: PlaySessionStateNotification
if state == "playing":
if self.progressbar is not None:
self.progressbar.play(m.plex, percent)
self.set_window_title(f"Watching {m.title}")

return self.scrobblers[tm].update(percent)

if state == "paused":
if self.progressbar is not None:
self.progressbar.pause(m.plex, percent)
self.clear_window_title()

return self.scrobblers[tm].pause(percent)

if state == "stopped":
if self.progressbar is not None:
self.progressbar.stop(m.plex)
self.clear_window_title()

value = self.scrobblers[tm].stop(percent)
del self.scrobblers[tm]
Expand Down

0 comments on commit b3af8f2

Please sign in to comment.