Skip to content

Commit

Permalink
Fix localhost connection breaking mpv chat (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
Et0h committed Feb 19, 2023
1 parent 0307cda commit e1bcf12
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion syncplay/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,9 @@ def setServerVersion(self, version, featureList):
self.serverVersion = version
self.checkForFeatureSupport(featureList)

def sendFeaturesToPlayer(self):
self._player.setFeatures(self.serverFeatures)

def checkForFeatureSupport(self, featureList):
self.serverFeatures = {
"featureList": utils.meetsMinVersion(self.serverVersion, constants.FEATURE_LIST_MIN_VERSION),
Expand Down Expand Up @@ -671,7 +674,10 @@ def checkForFeatureSupport(self, featureList):
"backslashSubstituteCharacter={}".format(constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER)]
self.ui.setFeatures(self.serverFeatures)
if self._player:
self._player.setFeatures(self.serverFeatures)
self.sendFeaturesToPlayer()
else:
# Player might not have been loaded if connecting to localhost (#545)
self.addPlayerReadyCallback(lambda x: self.sendFeaturesToPlayer())

def getSanitizedCurrentUserFile(self):
if self.userlist.currentUser.file:
Expand Down

0 comments on commit e1bcf12

Please sign in to comment.