Skip to content

Commit

Permalink
Refactor to have reusabe reset_title() method
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Aug 30, 2023
1 parent b3af8f2 commit 7b1aeae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plextraktsync/watch/WatchStateUpdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,15 @@ def find_by_key(self, key: str, reload=False):

return m

@property
def server(self):
return self.plex.plex

def on_start(self, event: ServerStarted):
self.set_window_title(f"watch: {event.server.friendlyName} ({event.server.version})")
self.reset_title()

def reset_title(self):
self.set_window_title(f"watch: {self.server.friendlyName} ({self.server.version})")

def on_error(self, error: Error):
self.logger.error(error.msg)
Expand Down

0 comments on commit 7b1aeae

Please sign in to comment.