Fixed handling escaped pipes in files for mpc

This commit is contained in:
Uriziel 2012-12-16 14:05:17 +01:00
parent d4ec7dac6e
commit 71c00d5928

View File

@ -5,6 +5,7 @@ import thread
import win32con, win32api, win32gui, ctypes, ctypes.wintypes #@UnresolvedImport @UnusedImport import win32con, win32api, win32gui, ctypes, ctypes.wintypes #@UnresolvedImport @UnusedImport
from functools import wraps from functools import wraps
from syncplay.players.basePlayer import BasePlayer from syncplay.players.basePlayer import BasePlayer
import re
class MPCHCAPIPlayer(BasePlayer): class MPCHCAPIPlayer(BasePlayer):
speedSupported = False speedSupported = False
@ -262,7 +263,7 @@ class MpcHcApi:
thread.start_new_thread(self.callbacks.onUpdatePlaystate, (self.playState,)) thread.start_new_thread(self.callbacks.onUpdatePlaystate, (self.playState,))
elif(cmd == self.CMD_NOWPLAYING): elif(cmd == self.CMD_NOWPLAYING):
value = value.split('|') value = re.split(r'(?<!\\)\|', value)
self.filePath = value[3] self.filePath = value[3]
self.filePlaying = value[3].split('\\').pop() self.filePlaying = value[3].split('\\').pop()
self.fileDuration = float(value[4]) self.fileDuration = float(value[4])