Fix sessions check in watch
sessions is empty dict, so if sessions will be failse even it's not None
MODIFY
plextraktsync/watch/WatchStateUpdater.py
plextraktsync/watch/WatchStateUpdater.py
@@ -93,7 +93,7 @@ def find_by_key(self, key: str, reload=False):
def on_error(self, error: Error):
self.logger.error(error.msg)
self.scrobblers.clear()
- if self.sessions:
+ if self.sessions is not None:
self.sessions.clear()
def on_activity(self, activity: ActivityNotification):
@@ -166,6 +166,6 @@ def scrobble(self, m: Media, percent: float, event: PlaySessionStateNotification
value = self.scrobblers[tm].stop(percent)
del self.scrobblers[tm]
- if self.sessions:
+ if self.sessions is not None:
del self.sessions[event.session_key]
return value

Fix sessions check in watch

sessions is empty dict, so if sessions will be failse even it's not None