Skip to content

Commit

Permalink
Make mpv code compatible with mpvnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Et0h committed Aug 7, 2019
1 parent 0332af0 commit 0f284e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion syncplay/__init__.py
@@ -1,5 +1,5 @@
version = '1.6.5'
revision = ' development'
milestone = 'Yoitsu'
release_number = '80'
release_number = '81'
projectURL = 'https://syncplay.pl/'
6 changes: 3 additions & 3 deletions syncplay/players/mpv.py
Expand Up @@ -128,15 +128,15 @@ class NewMpvPlayer(OldMpvPlayer):
def displayMessage(self, message, duration=(constants.OSD_DURATION * 1000), OSDType=constants.OSD_NOTIFICATION,
mood=constants.MESSAGE_NEUTRAL):
if not self._client._config["chatOutputEnabled"]:
super(self.__class__, self).displayMessage(message=message, duration=duration, OSDType=OSDType, mood=mood)
MplayerPlayer.displayMessage(self, message=message, duration=duration, OSDType=OSDType, mood=mood)
return
messageString = self._sanitizeText(message.replace("\\n", "<NEWLINE>")).replace(
"\\\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER).replace("<NEWLINE>", "\\n")
self._listener.sendLine('script-message-to syncplayintf {}-osd-{} "{}"'.format(OSDType, mood, messageString))

def displayChatMessage(self, username, message):
if not self._client._config["chatOutputEnabled"]:
super(self.__class__, self).displayChatMessage(username, message)
MplayerPlayer.displayChatMessage(self, username, message)
return
username = self._sanitizeText(username.replace("\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER))
message = self._sanitizeText(message.replace("\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER))
Expand Down Expand Up @@ -252,7 +252,7 @@ def setPosition(self, value):
self._client.ui.showDebugMessage(
"Did not seek as recently reset and {} below 'do not reset position' threshold".format(value))
return
super(self.__class__, self).setPosition(value)
MplayerPlayer.setPosition(self, value)
self.lastMPVPositionUpdate = time.time()

def openFile(self, filePath, resetPosition=False):
Expand Down

0 comments on commit 0f284e7

Please sign in to comment.