mirror of
https://github.com/Syncplay/syncplay
synced 2024-12-15 19:35:07 +00:00
Fix server error when trying to getPosition when position is none
This commit is contained in:
parent
1194cce05a
commit
e2617088b8
@ -256,8 +256,10 @@ class Room(object):
|
||||
self.__position = watcher.getPosition()
|
||||
self.__lastUpdate = time.time()
|
||||
return self.__position
|
||||
else:
|
||||
elif self.__position is not None:
|
||||
return self.__position + (age if self._playState == self.STATE_PLAYING else 0)
|
||||
else:
|
||||
return 0
|
||||
|
||||
def setPaused(self, paused=STATE_PAUSED, setBy=None):
|
||||
self._playState = paused
|
||||
@ -326,8 +328,10 @@ class ControlledRoom(Room):
|
||||
self.__position = watcher.getPosition()
|
||||
self.__lastUpdate = time.time()
|
||||
return self.__position
|
||||
else:
|
||||
elif self.__position is not None:
|
||||
return self.__position + (age if self._playState == self.STATE_PLAYING else 0)
|
||||
else:
|
||||
return 0
|
||||
|
||||
def addController(self, watcher):
|
||||
self._controllers[watcher.getName()] = watcher
|
||||
|
Loading…
Reference in New Issue
Block a user