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()
|
||||
|
||||
'''
|
||||
@type playerPath: string
|
||||
@type filePath: string
|
||||
@return errorMessage: string
|
||||
|
||||
Checks if the player has any problems with the given file (or lack of file)
|
||||
If a problem is detected then it returns the error message
|
||||
If the file is fine then it returns None
|
||||
Checks if the player has any problems with the given player/file path
|
||||
'''
|
||||
@staticmethod
|
||||
def getFilePathErrors(filePath):
|
||||
def getPlayerPathErrors(playerPath, filePath):
|
||||
raise NotImplementedError()
|
||||
|
||||
class DummyPlayer(BasePlayer):
|
||||
@ -121,5 +120,5 @@ class DummyPlayer(BasePlayer):
|
||||
return path
|
||||
|
||||
@staticmethod
|
||||
def getFilePathErrors(filePath):
|
||||
return None
|
||||
def getPlayerPathErrors(playerPath, filePath):
|
||||
return None
|
@ -333,7 +333,7 @@ class MPCHCAPIPlayer(BasePlayer):
|
||||
self._mpcApi.sendRawCommand(MpcHcApi.CMD_CLOSEAPP, "")
|
||||
|
||||
@staticmethod
|
||||
def getFilePathErrors(filePath):
|
||||
def getPlayerPathErrors(playerPath, filePath):
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
|
@ -213,7 +213,7 @@ class MplayerPlayer(BasePlayer):
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def getFilePathErrors(filePath):
|
||||
def getPlayerPathErrors(playerPath, filePath):
|
||||
if not filePath:
|
||||
return getMessage("no-file-path-config-error")
|
||||
|
||||
|
@ -201,7 +201,7 @@ class VlcPlayer(BasePlayer):
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def getFilePathErrors(filePath):
|
||||
def getPlayerPathErrors(playerPath, filePath):
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
|
@ -145,9 +145,9 @@ class ConfigurationGetter(object):
|
||||
self._config["playerClass"] = player
|
||||
else:
|
||||
raise InvalidConfigValue(getMessage("player-path-config-error"))
|
||||
fileErrors = player.getFilePathErrors(self._config['file'] if self._config['file'] else None)
|
||||
if fileErrors:
|
||||
raise InvalidConfigValue(fileErrors)
|
||||
playerPathErrors = player.getPlayerPathErrors(self._config["playerPath"], self._config['file'] if self._config['file'] else None)
|
||||
if playerPathErrors:
|
||||
raise InvalidConfigValue(playerPathErrors)
|
||||
elif key == "host":
|
||||
self._config["host"], self._config["port"] = self._splitPortAndHost(self._config["host"])
|
||||
hostNotValid = (self._config["host"] == "" or self._config["host"] is None)
|
||||
|
Loading…
Reference in New Issue
Block a user