MCPcopy Create free account
hub / github.com/Syncplay/syncplay / getPosition

Method getPosition

syncplay/server.py:598–609  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

596 return self._name
597
598 def getPosition(self):
599 age = time.time() - self._lastUpdate
600 if self._watchers and age > 1:
601 watcher = min(self._watchers.values())
602 self._setBy = watcher
603 self._position = watcher.getPosition()
604 self._lastSavedUpdate = self._lastUpdate = time.time()
605 return self._position
606 elif self._position is not None:
607 return self._position + (age if self._playState == self.STATE_PLAYING else 0)
608 else:
609 return 0
610
611 def setPaused(self, paused=STATE_PAUSED, setBy=None):
612 self._playState = paused

Callers 5

addWatcherMethod · 0.95
sendStateMethod · 0.45
forcePositionUpdateMethod · 0.45
getPositionMethod · 0.45
__lt__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected