diff --git a/syncplay/constants.py b/syncplay/constants.py index f3b9a0d..5a7a888 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -131,7 +131,7 @@ COMMANDS_DELETE = ['delete', 'd', 'qd'] MPC_MIN_VER = "1.6.4" MPC_BE_MIN_VER = "1.5.2.3123" VLC_MIN_VERSION = "2.2.1" -VLC_INTERFACE_VERSION = "0.3.5" +VLC_INTERFACE_VERSION = "0.3.6" VLC_LATENCY_ERROR_THRESHOLD = 2.0 MPV_UNRESPONSIVE_THRESHOLD = 60.0 CONTROLLED_ROOMS_MIN_VERSION = "1.3.0" diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 802e379..e07427f 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -133,10 +133,11 @@ de = { "not-json-error": "Kein JSON-String\n", "hello-arguments-error": "Zu wenige Hello-Argumente\n", "version-mismatch-error": "Verschiedene Versionen auf Client und Server\n", - "vlc-failed-connection": "Kann nicht zu VLC verbinden. Wenn du syncplay.lua nicht installiert hast, findest du auf https://syncplay.pl/LUA/ [Englisch] eine Anleitung.", + "vlc-failed-connection": "Kann nicht zu VLC verbinden. Wenn du syncplay.lua nicht installiert hast, findest du auf https://syncplay.pl/LUA/ [Englisch] eine Anleitung. VLC 4 does not support Syncplay.", # TO DO: TRANSLATE "vlc-failed-noscript": "Laut VLC ist das syncplay.lua Interface-Skript nicht installiert. Auf https://syncplay.pl/LUA/ [Englisch] findest du eine Anleitung.", - "vlc-failed-versioncheck": "Diese VLC-Version wird von Syncplay nicht unterstützt. Bitte nutze VLC 2.0", + "vlc-initial-warning": 'VLC does not always provide accurate position information to Syncplay, especially for .mp4 and .avi files. If you experience problems with erroneous seeking then please try an alternative media player such as mpv.', # TODO: Translate + "feature-sharedPlaylists": "Geteilte Playlists", # used for not-supported-by-server-error "feature-chat": "Chat", # used for not-supported-by-server-error "feature-readiness": "Bereitschaftsstatus", # used for not-supported-by-server-error diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 243c1ad..824b23c 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -133,9 +133,10 @@ en = { "not-json-error": "Not a json encoded string\n", "hello-arguments-error": "Not enough Hello arguments\n", # DO NOT TRANSLATE "version-mismatch-error": "Mismatch between versions of client and server\n", - "vlc-failed-connection": "Failed to connect to VLC. If you have not installed syncplay.lua and are using the latest verion of VLC then please refer to https://syncplay.pl/LUA/ for instructions.", + "vlc-failed-connection": "Failed to connect to VLC. If you have not installed syncplay.lua and are using the latest verion of VLC then please refer to https://syncplay.pl/LUA/ for instructions. VLC 4 does not support Syncplay.", "vlc-failed-noscript": "VLC has reported that the syncplay.lua interface script has not been installed. Please refer to https://syncplay.pl/LUA/ for instructions.", "vlc-failed-versioncheck": "This version of VLC is not supported by Syncplay.", + "vlc-initial-warning": 'VLC does not always provide accurate position information to Syncplay, especially for .mp4 and .avi files. If you experience problems with erroneous seeking then please try an alternative media player such as mpv.', "feature-sharedPlaylists": "shared playlists", # used for not-supported-by-server-error "feature-chat": "chat", # used for not-supported-by-server-error diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index b705f98..33f8405 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -133,9 +133,10 @@ es = { "not-json-error": "No es una cadena de caracteres JSON válida\n", "hello-arguments-error": "Not enough Hello arguments\n", # DO NOT TRANSLATE "version-mismatch-error": "No coinciden las versiones del cliente y servidor\n", - "vlc-failed-connection": "Falló la conexión con VLC. Si no has instalado syncplay.lua y estás usando la última versión de VLC, por favor revisa https://syncplay.pl/LUA/ para obtener instrucciones.", + "vlc-failed-connection": "Falló la conexión con VLC. Si no has instalado syncplay.lua y estás usando la última versión de VLC, por favor revisa https://syncplay.pl/LUA/ para obtener instrucciones. VLC 4 does not support Syncplay.", # TO DO: TRANSLATE "vlc-failed-noscript": "VLC ha reportado que la interfaz syncplay.lua no se ha instalado. Por favor revisa https://syncplay.pl/LUA/ para obtener instrucciones.", "vlc-failed-versioncheck": "Esta versión de VLC no está soportada por Syncplay.", + "vlc-initial-warning": 'VLC does not always provide accurate position information to Syncplay, especially for .mp4 and .avi files. If you experience problems with erroneous seeking then please try an alternative media player such as mpv.', # TODO: Translatef "feature-sharedPlaylists": "listas de reproducción compartidas", # used for not-supported-by-server-error "feature-chat": "chat", # used for not-supported-by-server-error diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 028bb11..97f8e1f 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -133,9 +133,10 @@ it = { "not-json-error": "Non è una stringa con codifica JSON\n", "hello-arguments-error": "Not enough Hello arguments\n", # DO NOT TRANSLATE "version-mismatch-error": "La versione del client è diversa da quella del server\n", - "vlc-failed-connection": "Impossibile collegarsi a VLC. Se non hai installato syncplay.lua e stai usando l'ultima versione di VLC, fai riferimento a https://syncplay.pl/LUA/ per istruzioni.", + "vlc-failed-connection": "Impossibile collegarsi a VLC. Se non hai installato syncplay.lua e stai usando l'ultima versione di VLC, fai riferimento a https://syncplay.pl/LUA/ per istruzioni. VLC 4 does not support Syncplay.", # TO DO: TRANSLATE "vlc-failed-noscript": "VLC ha segnalato che lo script di interfaccia syncplay.lua non è stato installato. Per favore, fai riferimento a https://syncplay.pl/LUA/ per istruzioni.", "vlc-failed-versioncheck": "Questa versione di VLC non è supportata da Syncplay.", + "vlc-initial-warning": 'VLC does not always provide accurate position information to Syncplay, especially for .mp4 and .avi files. If you experience problems with erroneous seeking then please try an alternative media player such as mpv.', # TODO: Translate "feature-sharedPlaylists": "playlist condivise", # used for not-supported-by-server-error "feature-chat": "chat", # used for not-supported-by-server-error diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py index 7f85976..ab42e2e 100644 --- a/syncplay/messages_pt_BR.py +++ b/syncplay/messages_pt_BR.py @@ -133,9 +133,10 @@ pt_BR = { "not-json-error": "Não é uma string codificada como JSON\n", "hello-arguments-error": "Not enough Hello arguments\n", # DO NOT TRANSLATE "version-mismatch-error": "Discrepância entre versões do client e do servidor\n", - "vlc-failed-connection": "Falha ao conectar ao VLC. Se você não instalou o syncplay.lua e está usando a versão mais recente do VLC, por favor veja https://syncplay.pl/LUA/ para mais instruções.", + "vlc-failed-connection": "Falha ao conectar ao VLC. Se você não instalou o syncplay.lua e está usando a versão mais recente do VLC, por favor veja https://syncplay.pl/LUA/ para mais instruções. VLC 4 does not support Syncplay.", # TO DO: TRANSLATE "vlc-failed-noscript": "O VLC reportou que a interface de script do syncplay.lua não foi instalada. Por favor, veja https://syncplay.pl/LUA/ para mais instruções.", "vlc-failed-versioncheck": "Esta versão do VLC não é suportada pelo Syncplay.", + "vlc-initial-warning": 'VLC does not always provide accurate position information to Syncplay, especially for .mp4 and .avi files. If you experience problems with erroneous seeking then please try an alternative media player such as mpv.', # TODO: Translate "feature-sharedPlaylists": "playlists compartilhadas", # used for not-supported-by-server-error "feature-chat": "chat", # used for not-supported-by-server-error diff --git a/syncplay/messages_pt_PT.py b/syncplay/messages_pt_PT.py index f0fb92b..6f63dc7 100644 --- a/syncplay/messages_pt_PT.py +++ b/syncplay/messages_pt_PT.py @@ -133,9 +133,10 @@ pt_PT = { "not-json-error": "Não é uma string codificada como JSON\n", "hello-arguments-error": "Falta de argumentos Hello\n", # DO NOT TRANSLATE "version-mismatch-error": "Discrepância entre versões do cliente e do servidor\n", - "vlc-failed-connection": "Falha ao conectar ao VLC. Se você não instalou o syncplay.lua e está usando a versão mais recente do VLC, por favor veja https://syncplay.pl/LUA/ para mais instruções.", + "vlc-failed-connection": "Falha ao conectar ao VLC. Se você não instalou o syncplay.lua e está usando a versão mais recente do VLC, por favor veja https://syncplay.pl/LUA/ para mais instruções. VLC 4 does not support Syncplay.", # TO DO: TRANSLATE "vlc-failed-noscript": "O VLC reportou que a interface de script do syncplay.lua não foi instalada. Por favor, veja https://syncplay.pl/LUA/ para mais instruções.", "vlc-failed-versioncheck": "Esta versão do VLC não é suportada pelo Syncplay.", + "vlc-initial-warning": 'VLC does not always provide accurate position information to Syncplay, especially for .mp4 and .avi files. If you experience problems with erroneous seeking then please try an alternative media player such as mpv.', # TODO: Translate "feature-sharedPlaylists": "playlists compartilhadas", # used for not-supported-by-server-error "feature-chat": "chat", # used for not-supported-by-server-error diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 242abcc..7fb6b2c 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -133,9 +133,10 @@ ru = { "not-json-error": "Не является закодированной json-строкой\n", "hello-arguments-error": "Не хватает аргументов Hello\n", "version-mismatch-error": "Конфликт версий между клиентом и сервером\n", - "vlc-failed-connection": "Ошибка подключения к VLC. Если у Вас не установлен syncplay.lua, то обратитесь к https://syncplay.pl/LUA/ за инструкциями.", + "vlc-failed-connection": "Ошибка подключения к VLC. Если у Вас не установлен syncplay.lua, то обратитесь к https://syncplay.pl/LUA/ за инструкциями. VLC 4 does not support Syncplay.", # TO DO: TRANSLATE "vlc-failed-noscript": "VLC сообщает, что скрипт интерфейса syncplay.lua не установлен. Пожалуйста, обратитесь к https://syncplay.pl/LUA/ за инструкциями.", "vlc-failed-versioncheck": "Данная версия VLC не поддерживается Syncplay. Пожалуйста, используйте VLC версии 2 или выше.", + "vlc-initial-warning": 'VLC does not always provide accurate position information to Syncplay, especially for .mp4 and .avi files. If you experience problems with erroneous seeking then please try an alternative media player such as mpv.', # TODO: Translate "feature-sharedPlaylists": "shared playlists", # used for not-supported-by-server-error # TODO: Translate "feature-chat": "chat", # used for not-supported-by-server-error # TODO: Translate diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index 4053877..71d69a2 100755 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -441,39 +441,18 @@ class VlcPlayer(BasePlayer): else: self.__playerController._client.ui.showDebugMessage("syncplay.lua intf directory not found, so creating directory '{}'".format(vlcSyncplayInterfaceDir)) Path(vlcSyncplayInterfaceDir).mkdir(mode=0o755, parents=True, exist_ok=True) - def _intfNeedsUpdating(vlcSyncplayInterfacePath): - self.__playerController._client.ui.showDebugMessage("Checking if '{}' exists and if it is the expected version".format(vlcSyncplayInterfacePath)) - if not os.path.isfile(vlcSyncplayInterfacePath): - self.__playerController._client.ui.showDebugMessage("syncplay.lua not found, so file needs copying") - return True - if os.path.isfile(vlcSyncplayInterfacePath): - with open(vlcSyncplayInterfacePath, 'rU') as interfacefile: - for line in interfacefile: - if "local connectorversion" in line: - interface_version = line[26:31] - if interface_version == constants.VLC_INTERFACE_VERSION: - self.__playerController._client.ui.showDebugMessage("syncplay.lua exists and is expected version, so no file needs copying") - return False - else: - self.oldIntfVersion = line[26:31] - self.__playerController._client.ui.showDebugMessage("syncplay.lua is {} but expected version is {} so file needs to be copied".format(interface_version, constants.VLC_INTERFACE_VERSION)) - return True - self.__playerController._client.ui.showDebugMessage("Up-to-dateness checks failed, so copy the file.") - return True - if _intfNeedsUpdating(os.path.join(self.__playerController.vlcIntfUserPath, "syncplay.lua")): - try: - _createIntfFolder(self.__playerController.vlcIntfUserPath) - copyForm = utils.findResourcePath("syncplay.lua") - copyTo = os.path.join(self.__playerController.vlcIntfUserPath, "syncplay.lua") - self.__playerController._client.ui.showDebugMessage("Copying VLC Lua Interface from '{}' to '{}'".format(copyForm, copyTo)) - import shutil - if os.path.exists(copyTo): - os.chmod(copyTo, 0o755) - shutil.copyfile(copyForm, copyTo) + _createIntfFolder(self.__playerController.vlcIntfUserPath) + copyForm = utils.findResourcePath("syncplay.lua") + copyTo = os.path.join(self.__playerController.vlcIntfUserPath, "syncplay.lua") + self.__playerController._client.ui.showDebugMessage("Copying VLC Lua Interface from '{}' to '{}'".format(copyForm, copyTo)) + import shutil + if os.path.exists(copyTo): os.chmod(copyTo, 0o755) - except Exception as e: - self.__playerController._client.ui.showErrorMessage(e) - return + shutil.copyfile(copyForm, copyTo) + os.chmod(copyTo, 0o755) + except Exception as e: + self.__playerController._client.ui.showErrorMessage(e) + return if isLinux(): self.__playerController.vlcDataPath = "/usr/lib/syncplay/resources" else: diff --git a/syncplay/resources/lua/intf/syncplay.lua b/syncplay/resources/lua/intf/syncplay.lua index 54ce65f..0f0a7ac 100644 --- a/syncplay/resources/lua/intf/syncplay.lua +++ b/syncplay/resources/lua/intf/syncplay.lua @@ -5,7 +5,7 @@ Principal author: Etoh Other contributors: DerGenaue, jb, Pilotat Project: https://syncplay.pl/ - Version: 0.3.5 + Version: 0.3.6 Note: * This interface module is intended to be used in conjunction with Syncplay. @@ -78,9 +78,14 @@ Syncplay should install this automatically to your user folder. --]==========================================================================] -local connectorversion = "0.3.5" +local connectorversion = "0.3.6" local vlcversion = vlc.misc.version() local vlcmajorversion = tonumber(vlcversion:sub(1,1)) -- get the major version of VLC + +if vlcmajorversion > 3 then + vlc.misc.quit() +end + local durationdelay = 500000 -- Pause for get_duration command etc for increased reliability (uses microseconds) local loopsleepduration = 2500 -- Pause for every event loop (uses microseconds) local quitcheckfrequency = 20 -- Check whether VLC has closed every X loops diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index a5c324a..99f0ccd 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -903,6 +903,7 @@ class MainWindow(QtWidgets.QMainWindow): QtWidgets.QMessageBox.critical(self, "Syncplay", message) message = message.replace("&", "&").replace('"', """).replace("<", "<").replace(">", ">") message = message.replace("<a href="https://syncplay.pl/trouble">", '').replace("</a>", "") + message = message.replace("<a href="https://mpv.io/">", '').replace("</a>", "") message = message.replace("\n", "
") if isDarkMode: message = "".format(constants.STYLE_DARK_ERRORNOTIFICATION) + message + ""