Proper dropping if mpc version too low
This commit is contained in:
parent
6f1bc51d5f
commit
a3c446fc83
@ -349,9 +349,10 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
|
|
||||||
def __dropIfNotSufficientVersion(self):
|
def __dropIfNotSufficientVersion(self):
|
||||||
self._mpcApi.askForVersion()
|
self._mpcApi.askForVersion()
|
||||||
if(not self.__versionUpdate.wait(0.1) and self._mpcApi.version):
|
if(not self.__versionUpdate.wait(0.1) or not self._mpcApi.version):
|
||||||
self.__mpcError("MPC version not sufficient, please use `mpc-hc` >= `1.6.4`")
|
self.__mpcError("MPC version not sufficient, please use `mpc-hc` >= `1.6.4`")
|
||||||
|
self.__client.stop(True)
|
||||||
|
|
||||||
def __testMpcReady(self):
|
def __testMpcReady(self):
|
||||||
if(not self.__preventAsking.wait(10)):
|
if(not self.__preventAsking.wait(10)):
|
||||||
raise Exception("Player failed opening file")
|
raise Exception("Player failed opening file")
|
||||||
@ -369,6 +370,8 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
|
|
||||||
def initPlayer(self, filePath):
|
def initPlayer(self, filePath):
|
||||||
self.__dropIfNotSufficientVersion()
|
self.__dropIfNotSufficientVersion()
|
||||||
|
if(not self._mpcApi.version):
|
||||||
|
return
|
||||||
self.__mpcVersion = self._mpcApi.version.split('.')
|
self.__mpcVersion = self._mpcApi.version.split('.')
|
||||||
if(self.__mpcVersion[0:3] == ['1', '6', '4']):
|
if(self.__mpcVersion[0:3] == ['1', '6', '4']):
|
||||||
self.__switchPauseCalls = True
|
self.__switchPauseCalls = True
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user