Fix server error when trying to getPosition when position is none

This commit is contained in:
Et0h 2016-02-07 15:38:50 +00:00
parent 1194cce05a
commit e2617088b8

View File

@ -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