diff --git a/syncplay/players/basePlayer.py b/syncplay/players/basePlayer.py index 4609757..c8fdcc2 100644 --- a/syncplay/players/basePlayer.py +++ b/syncplay/players/basePlayer.py @@ -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 \ No newline at end of file diff --git a/syncplay/players/mpc.py b/syncplay/players/mpc.py index a62ac95..d9303a1 100644 --- a/syncplay/players/mpc.py +++ b/syncplay/players/mpc.py @@ -333,7 +333,7 @@ class MPCHCAPIPlayer(BasePlayer): self._mpcApi.sendRawCommand(MpcHcApi.CMD_CLOSEAPP, "") @staticmethod - def getFilePathErrors(filePath): + def getPlayerPathErrors(playerPath, filePath): return None @staticmethod diff --git a/syncplay/players/mplayer.py b/syncplay/players/mplayer.py index c5f2a4f..773df35 100644 --- a/syncplay/players/mplayer.py +++ b/syncplay/players/mplayer.py @@ -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") diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index 3e1b3ae..e7bba8b 100644 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -201,7 +201,7 @@ class VlcPlayer(BasePlayer): return False @staticmethod - def getFilePathErrors(filePath): + def getPlayerPathErrors(playerPath, filePath): return None @staticmethod diff --git a/syncplay/ui/ConfigurationGetter.py b/syncplay/ui/ConfigurationGetter.py index fc654aa..b4de8a6 100755 --- a/syncplay/ui/ConfigurationGetter.py +++ b/syncplay/ui/ConfigurationGetter.py @@ -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)