(self, state)
| 744 | |
| 745 | @requireLogged |
| 746 | def handleState(self, state): |
| 747 | position, paused, doSeek, latencyCalculation = None, None, None, None |
| 748 | if "ignoringOnTheFly" in state: |
| 749 | ignore = state["ignoringOnTheFly"] |
| 750 | if "server" in ignore: |
| 751 | if self.serverIgnoringOnTheFly == ignore["server"]: |
| 752 | self.serverIgnoringOnTheFly = 0 |
| 753 | if "client" in ignore: |
| 754 | self.clientIgnoringOnTheFly = ignore["client"] |
| 755 | if "playstate" in state: |
| 756 | position, paused, doSeek = self._extractStatePlaystateArguments(state) |
| 757 | if "ping" in state: |
| 758 | latencyCalculation = state["ping"]["latencyCalculation"] if "latencyCalculation" in state["ping"] else 0 |
| 759 | clientRtt = state["ping"]["clientRtt"] if "clientRtt" in state["ping"] else 0 |
| 760 | self._clientLatencyCalculation = state["ping"]["clientLatencyCalculation"] if "clientLatencyCalculation" in state["ping"] else 0 |
| 761 | self._clientLatencyCalculationArrivalTime = time.time() |
| 762 | self._pingService.receiveMessage(latencyCalculation, clientRtt) |
| 763 | if self.serverIgnoringOnTheFly == 0: |
| 764 | self._watcher.updateState(position, paused, doSeek, self._pingService.getLastForwardDelay()) |
| 765 | |
| 766 | def handleError(self, error): |
| 767 | self.dropWithError(error["message"]) # TODO: more processing and fallbacking |
nothing calls this directly
no test coverage detected