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

Method getPosition

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

Source from the content-addressed store, hash-verified

679 self._controllers = {}
680
681 def getPosition(self):
682 age = time.time() - self._lastUpdate
683 if self._controllers and age > 1:
684 watcher = min(self._controllers.values())
685 self._setBy = watcher
686 self._position = watcher.getPosition()
687 self._lastUpdate = time.time()
688 return self._position
689 elif self._position is not None:
690 return self._position + (age if self._playState == self.STATE_PLAYING else 0)
691 else:
692 return 0
693
694 def addController(self, watcher):
695 self._controllers[watcher.getName()] = watcher

Callers

nothing calls this directly

Calls 1

getPositionMethod · 0.45

Tested by

no test coverage detected