mirror of
https://github.com/Syncplay/syncplay
synced 2025-02-07 14:41:40 +00:00
Broaden getFilePathErrors into getPlayerPathErrors
This commit is contained in:
parent
45e576e4f2
commit
7ca29bf30b
@ -91,15 +91,14 @@ class BasePlayer(object):
|
|||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
@type playerPath: string
|
||||||
@type filePath: string
|
@type filePath: string
|
||||||
@return errorMessage: string
|
@return errorMessage: string
|
||||||
|
|
||||||
Checks if the player has any problems with the given file (or lack of file)
|
Checks if the player has any problems with the given player/file path
|
||||||
If a problem is detected then it returns the error message
|
|
||||||
If the file is fine then it returns None
|
|
||||||
'''
|
'''
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getFilePathErrors(filePath):
|
def getPlayerPathErrors(playerPath, filePath):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
class DummyPlayer(BasePlayer):
|
class DummyPlayer(BasePlayer):
|
||||||
@ -121,5 +120,5 @@ class DummyPlayer(BasePlayer):
|
|||||||
return path
|
return path
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getFilePathErrors(filePath):
|
def getPlayerPathErrors(playerPath, filePath):
|
||||||
return None
|
return None
|
@ -333,7 +333,7 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
self._mpcApi.sendRawCommand(MpcHcApi.CMD_CLOSEAPP, "")
|
self._mpcApi.sendRawCommand(MpcHcApi.CMD_CLOSEAPP, "")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getFilePathErrors(filePath):
|
def getPlayerPathErrors(playerPath, filePath):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -213,7 +213,7 @@ class MplayerPlayer(BasePlayer):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getFilePathErrors(filePath):
|
def getPlayerPathErrors(playerPath, filePath):
|
||||||
if not filePath:
|
if not filePath:
|
||||||
return getMessage("no-file-path-config-error")
|
return getMessage("no-file-path-config-error")
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ class VlcPlayer(BasePlayer):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getFilePathErrors(filePath):
|
def getPlayerPathErrors(playerPath, filePath):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -145,9 +145,9 @@ class ConfigurationGetter(object):
|
|||||||
self._config["playerClass"] = player
|
self._config["playerClass"] = player
|
||||||
else:
|
else:
|
||||||
raise InvalidConfigValue(getMessage("player-path-config-error"))
|
raise InvalidConfigValue(getMessage("player-path-config-error"))
|
||||||
fileErrors = player.getFilePathErrors(self._config['file'] if self._config['file'] else None)
|
playerPathErrors = player.getPlayerPathErrors(self._config["playerPath"], self._config['file'] if self._config['file'] else None)
|
||||||
if fileErrors:
|
if playerPathErrors:
|
||||||
raise InvalidConfigValue(fileErrors)
|
raise InvalidConfigValue(playerPathErrors)
|
||||||
elif key == "host":
|
elif key == "host":
|
||||||
self._config["host"], self._config["port"] = self._splitPortAndHost(self._config["host"])
|
self._config["host"], self._config["port"] = self._splitPortAndHost(self._config["host"])
|
||||||
hostNotValid = (self._config["host"] == "" or self._config["host"] is None)
|
hostNotValid = (self._config["host"] == "" or self._config["host"] is None)
|
||||||
|
Loading…
Reference in New Issue
Block a user