From 902ba7a879c3c8b275955d824d4f3f379b7a6b7b Mon Sep 17 00:00:00 2001 From: Alberto Sottile Date: Wed, 5 Jun 2019 22:51:22 +0200 Subject: [PATCH 001/112] Embed libxkbcommon-x11-0 in the AppImage bundle --- .travis.yml | 3 +++ travis/appimage-script.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c571631..3a8e895 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,9 @@ matrix: dist: xenial python: 3.6 env: BUILD_DESTINATION=appimage + apt: + packages: + - libxkbcommon-x11-0 branches: only: diff --git a/travis/appimage-script.sh b/travis/appimage-script.sh index 8bd0ec0..56283c3 100755 --- a/travis/appimage-script.sh +++ b/travis/appimage-script.sh @@ -109,6 +109,6 @@ export OUTPUT=Syncplay-$VERSION-x86_64.AppImage ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin conda \ -e $(which readelf) \ -i "$REPO_ROOT"/syncplay/resources/syncplay.png -d pl.syncplay.syncplay.desktop \ - --output appimage --custom-apprun AppRun.sh + --output appimage --custom-apprun AppRun.sh -l /usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 mv Syncplay*.AppImage "$OLD_CWD" \ No newline at end of file From ed95359f0f05ed84ba0e695ad93ac71e73d0aca9 Mon Sep 17 00:00:00 2001 From: albertosottile Date: Wed, 5 Jun 2019 23:21:26 +0200 Subject: [PATCH 002/112] AppImage: install libxkbcommon-x11-0 explicitely --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3a8e895..167bfb3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,6 @@ matrix: dist: xenial python: 3.6 env: BUILD_DESTINATION=appimage - apt: - packages: - - libxkbcommon-x11-0 branches: only: @@ -27,7 +24,7 @@ script: install: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis/macos-install.sh ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "snapcraft" ]; then travis/snapcraft-install.sh ; fi -- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "appimage" ]; then ls -al ; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "appimage" ]; then sudo apt-get install libxkbcommon-x11-0 ; fi before_deploy: - ls -al From b334dd5e770b51750932181b9e957f1345bc058d Mon Sep 17 00:00:00 2001 From: Alberto Sottile Date: Tue, 18 Jun 2019 18:49:54 +0200 Subject: [PATCH 003/112] Do not ask to press enter from CLI after quitting mpv Fixes: #238 --- syncplay/players/mplayer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/players/mplayer.py b/syncplay/players/mplayer.py index b1baa6b..a46e77f 100755 --- a/syncplay/players/mplayer.py +++ b/syncplay/players/mplayer.py @@ -305,7 +305,7 @@ class MplayerPlayer(BasePlayer): def drop(self): self._listener.sendLine('quit') self._takeLocksDown() - self.reactor.callFromThread(self._client.stop, True) + self.reactor.callFromThread(self._client.stop, False) class __Listener(threading.Thread): def __init__(self, playerController, playerPath, filePath, args): From 291463bb0d28e9147231e3286f293fb05e20c21d Mon Sep 17 00:00:00 2001 From: Alberto Sottile Date: Fri, 21 Jun 2019 18:41:29 +0200 Subject: [PATCH 004/112] Upver to 1.6.4 / release 76 --- syncplay/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syncplay/__init__.py b/syncplay/__init__.py index 613ca26..9fcf140 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ -version = '1.6.3' +version = '1.6.4' revision = '' milestone = 'Yoitsu' -release_number = '75' +release_number = '76' projectURL = 'https://syncplay.pl/' From b37a514050d4617efc1ba7b84a061df18907d8f6 Mon Sep 17 00:00:00 2001 From: et0h Date: Fri, 21 Jun 2019 22:26:24 +0100 Subject: [PATCH 005/112] Fix issue displaying GuiConfig errors when using PyQt >= 5.12.1 (#240) --- syncplay/__init__.py | 2 +- syncplay/ui/GuiConfiguration.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/syncplay/__init__.py b/syncplay/__init__.py index 9fcf140..4572ef3 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ version = '1.6.4' revision = '' milestone = 'Yoitsu' -release_number = '76' +release_number = '77' projectURL = 'https://syncplay.pl/' diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index 5030333..ebb5889 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -711,7 +711,7 @@ class ConfigDialog(QtWidgets.QDialog): self.errorLabel.setStyleSheet(constants.STYLE_SUCCESSLABEL) self.errorLabel.setText(error) self.errorLabel.setAlignment(Qt.AlignCenter) - self.basicOptionsLayout.addWidget(self.errorLabel, 0, 0) + self.basicOptionsLayout.addWidget(self.errorLabel) self.connectionSettingsGroup.setMaximumHeight(self.connectionSettingsGroup.minimumSizeHint().height()) self.basicOptionsLayout.setAlignment(Qt.AlignTop) self.basicOptionsLayout.addWidget(self.connectionSettingsGroup) From 763406b6604679b984d685bea5036a70a228b6c9 Mon Sep 17 00:00:00 2001 From: albertosottile Date: Fri, 21 Jun 2019 23:34:06 +0200 Subject: [PATCH 006/112] ConfigDialog: adjust dialog height when errors are shown on macOS --- syncplay/ui/GuiConfiguration.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index ebb5889..f062707 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -1419,6 +1419,8 @@ class ConfigDialog(QtWidgets.QDialog): self.storeAndRunButton.setFocus() if isMacOS(): initialHeight = self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+50 + if self.error: + initialHeight += 40 self.setFixedWidth(self.sizeHint().width()) self.setFixedHeight(initialHeight) else: From 3ea4822e7f15c9bef998b5b9ba6b60e1f8c2a740 Mon Sep 17 00:00:00 2001 From: albertosottile Date: Fri, 21 Jun 2019 23:36:40 +0200 Subject: [PATCH 007/112] Upver to release 78 --- syncplay/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/__init__.py b/syncplay/__init__.py index 4572ef3..3f40e42 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ version = '1.6.4' revision = '' milestone = 'Yoitsu' -release_number = '77' +release_number = '78' projectURL = 'https://syncplay.pl/' From bcc3cbf44c0e5f3c847f9f0ef332b99f68a318ca Mon Sep 17 00:00:00 2001 From: Alberto Sottile Date: Sun, 23 Jun 2019 00:43:21 +0200 Subject: [PATCH 008/112] Explicitly set "start in" path in links generated by NSIS. Fixes: #241 --- buildPy2exe.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/buildPy2exe.py b/buildPy2exe.py index 58cda51..dc5b4c6 100755 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -389,6 +389,7 @@ NSIS_SCRIPT_TEMPLATE = r""" $${If} $$CheckBox_StartMenuShortcut_State == $${BST_CHECKED} CreateDirectory $$SMPROGRAMS\Syncplay + SetOutPath "$$INSTDIR" CreateShortCut "$$SMPROGRAMS\Syncplay\Syncplay.lnk" "$$INSTDIR\Syncplay.exe" "" CreateShortCut "$$SMPROGRAMS\Syncplay\Syncplay Server.lnk" "$$INSTDIR\syncplayServer.exe" "" CreateShortCut "$$SMPROGRAMS\Syncplay\Uninstall.lnk" "$$INSTDIR\Uninstall.exe" "" @@ -396,10 +397,12 @@ NSIS_SCRIPT_TEMPLATE = r""" $${EndIf} $${If} $$CheckBox_DesktopShortcut_State == $${BST_CHECKED} + SetOutPath "$$INSTDIR" CreateShortCut "$$DESKTOP\Syncplay.lnk" "$$INSTDIR\Syncplay.exe" "" $${EndIf} $${If} $$CheckBox_QuickLaunchShortcut_State == $${BST_CHECKED} + SetOutPath "$$INSTDIR" CreateShortCut "$$QUICKLAUNCH\Syncplay.lnk" "$$INSTDIR\Syncplay.exe" "" $${EndIf} FunctionEnd From a35c7a5c9ceb9ab1d34cb7886b748aa636a09944 Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 23 Jun 2019 11:40:20 +0100 Subject: [PATCH 009/112] Set 1.6.4 as most recent client --- syncplay/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/constants.py b/syncplay/constants.py index 7d63c03..a444409 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -29,7 +29,7 @@ MPLAYER_OSD_LEVEL = 1 UI_TIME_FORMAT = "[%X] " CONFIG_NAMES = [".syncplay", "syncplay.ini"] # Syncplay searches first to last DEFAULT_CONFIG_NAME = "syncplay.ini" -RECENT_CLIENT_THRESHOLD = "1.6.3" # This and higher considered 'recent' clients (no warnings) +RECENT_CLIENT_THRESHOLD = "1.6.4" # This and higher considered 'recent' clients (no warnings) WARN_OLD_CLIENTS = True # Use MOTD to inform old clients to upgrade LIST_RELATIVE_CONFIGS = True # Print list of relative configs loaded SHOW_CONTACT_INFO = True # Displays dev contact details below list in GUI From 1d8ae6ea5677cc623dbd3fff0b85e1b6deb46cbd Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 23 Jun 2019 11:53:06 +0100 Subject: [PATCH 010/112] Upver to 1.6.4a (release 79) and show revision in window title --- syncplay/__init__.py | 4 ++-- syncplay/ui/gui.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/syncplay/__init__.py b/syncplay/__init__.py index 3f40e42..c10619e 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ version = '1.6.4' -revision = '' +revision = 'a' milestone = 'Yoitsu' -release_number = '78' +release_number = '79' projectURL = 'https://syncplay.pl/' diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index f155c2d..87ffc77 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -1939,7 +1939,7 @@ class MainWindow(QtWidgets.QMainWindow): self.setWindowFlags(self.windowFlags()) else: self.setWindowFlags(self.windowFlags() & Qt.AA_DontUseNativeMenuBar) - self.setWindowTitle("Syncplay v" + version) + self.setWindowTitle("Syncplay v" + version + revision) self.mainLayout = QtWidgets.QVBoxLayout() self.addTopLayout(self) self.addBottomLayout(self) From 5aee6d97c916e4e6b8fc05c988ebd16409a26b94 Mon Sep 17 00:00:00 2001 From: Alberto Sottile Date: Sat, 6 Jul 2019 16:47:08 +0200 Subject: [PATCH 011/112] macOS: OS-related menus were in German when the OS lang set was English --- travis/macos-deploy.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/travis/macos-deploy.sh b/travis/macos-deploy.sh index 3fb21ab..2b192b9 100755 --- a/travis/macos-deploy.sh +++ b/travis/macos-deploy.sh @@ -1,9 +1,13 @@ #!/usr/bin/env bash +mkdir dist/Syncplay.app/Contents/Resources/English.lproj +mkdir dist/Syncplay.app/Contents/Resources/en_AU.lproj +mkdir dist/Syncplay.app/Contents/Resources/en_GB.lproj mkdir dist/Syncplay.app/Contents/Resources/German.lproj mkdir dist/Syncplay.app/Contents/Resources/Italian.lproj mkdir dist/Syncplay.app/Contents/Resources/ru.lproj mkdir dist/Syncplay.app/Contents/Resources/Spanish.lproj +mkdir dist/Syncplay.app/Contents/Resources/es_419.lproj pip3 install dmgbuild mv syncplay/resources/macOS_readme.pdf syncplay/resources/.macOS_readme.pdf dmgbuild -s appdmg.py "Syncplay" dist_bintray/Syncplay_${VER}.dmg From e7a475ddbed6273dae8257d0c41b9a3a004b7d34 Mon Sep 17 00:00:00 2001 From: Robin Lu Date: Fri, 26 Jul 2019 05:21:12 +0800 Subject: [PATCH 012/112] Misspell: change "inteface" to "interface" (#247) Changing "zope.inteface" to "zope.interface" for dependencies installation. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 84f4305..506c59c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ certifi>=2018.11.29 twisted[tls]>=16.4.0 appnope>=0.1.0; sys_platform == 'darwin' pypiwin32>=223; sys_platform == 'win32' -zope.inteface>=4.4.0; sys_platform == 'win32' \ No newline at end of file +zope.interface>=4.4.0; sys_platform == 'win32' From 187c8d87fc369faa9b0a71715f771b94ea9810fc Mon Sep 17 00:00:00 2001 From: et0h Date: Tue, 6 Aug 2019 00:17:19 +0100 Subject: [PATCH 013/112] Add initial mpv.net support --- syncplay/__init__.py | 6 ++-- syncplay/constants.py | 3 ++ syncplay/messages_de.py | 4 +-- syncplay/messages_en.py | 4 +-- syncplay/messages_es.py | 4 +-- syncplay/messages_it.py | 4 +-- syncplay/messages_ru.py | 4 +-- syncplay/players/__init__.py | 3 +- syncplay/players/mpv.py | 2 +- syncplay/players/mpvnet.py | 51 ++++++++++++++++++++++++++++++++++ syncplay/resources/mpvnet.ico | Bin 0 -> 25723 bytes 11 files changed, 70 insertions(+), 15 deletions(-) create mode 100644 syncplay/players/mpvnet.py create mode 100644 syncplay/resources/mpvnet.ico diff --git a/syncplay/__init__.py b/syncplay/__init__.py index c10619e..08032d7 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ -version = '1.6.4' -revision = 'a' +version = '1.6.5' +revision = ' development' milestone = 'Yoitsu' -release_number = '79' +release_number = '80' projectURL = 'https://syncplay.pl/' diff --git a/syncplay/constants.py b/syncplay/constants.py index a444409..7f0fcf5 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -155,6 +155,8 @@ MPLAYER_PATHS = ["mplayer2", "mplayer"] MPV_PATHS = ["mpv", "/opt/mpv/mpv", r"c:\program files\mpv\mpv.exe", r"c:\program files\mpv-player\mpv.exe", r"c:\program Files (x86)\mpv\mpv.exe", r"c:\program Files (x86)\mpv-player\mpv.exe", "/Applications/mpv.app/Contents/MacOS/mpv"] +MPVNET_PATHS = [r"c:\program files\mpv.net\mpvnet.exe", r"c:\program files\mpv.net\mpvnet.exe", + r"c:\program Files (x86)\mpv.net\mpvnet.exe", r"c:\program Files (x86)\mpv.net\mpvnet.exe"] VLC_PATHS = [ r"c:\program files (x86)\videolan\vlc\vlc.exe", r"c:\program files\videolan\vlc\vlc.exe", @@ -169,6 +171,7 @@ VLC_PATHS = [ VLC_ICONPATH = "vlc.png" MPLAYER_ICONPATH = "mplayer.png" MPV_ICONPATH = "mpv.png" +MPVNET_ICONPATH = "mpvnet.ico" MPC_ICONPATH = "mpc-hc.png" MPC64_ICONPATH = "mpc-hc64.png" MPC_BE_ICONPATH = "mpc-be.png" diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 070b7ca..4d1837f 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -108,7 +108,7 @@ de = { "mpc-be-version-insufficient-error": "MPC-Version nicht ausreichend, bitte nutze `mpc-be` >= `{}`", "mpv-version-error": "Syncplay ist nicht kompatibel mit dieser Version von mpv. Bitte benutze eine andere Version (z.B. Git HEAD).", "player-file-open-error": "Fehler beim Öffnen der Datei durch den Player", - "player-path-error": "Ungültiger Player-Pfad. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end + "player-path-error": "Ungültiger Player-Pfad. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end "hostname-empty-error": "Hostname darf nicht leer sein", "empty-error": "{} darf nicht leer sein", # Configuration "media-player-error": "Player-Fehler: \"{}\"", # Error line @@ -119,7 +119,7 @@ de = { "unable-to-start-client-error": "Client kann nicht gestartet werden", - "player-path-config-error": "Player-Pfad ist nicht ordnungsgemäß gesetzt. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2.", # To do: Translate end + "player-path-config-error": "Player-Pfad ist nicht ordnungsgemäß gesetzt. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2.", # To do: Translate end "no-file-path-config-error": "Es muss eine Datei ausgewählt werden, bevor der Player gestartet wird.", "no-hostname-config-error": "Hostname darf nicht leer sein", "invalid-port-config-error": "Port muss gültig sein", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 1f02846..b51ad1d 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -108,7 +108,7 @@ en = { "mpc-be-version-insufficient-error": "MPC version not sufficient, please use `mpc-be` >= `{}`", "mpv-version-error": "Syncplay is not compatible with this version of mpv. Please use a different version of mpv (e.g. Git HEAD).", "player-file-open-error": "Player failed opening file", - "player-path-error": "Player path is not set properly. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2", + "player-path-error": "Player path is not set properly. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2", "hostname-empty-error": "Hostname can't be empty", "empty-error": "{} can't be empty", # Configuration "media-player-error": "Media player error: \"{}\"", # Error line @@ -119,7 +119,7 @@ en = { "unable-to-start-client-error": "Unable to start client", - "player-path-config-error": "Player path is not set properly. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2.", + "player-path-config-error": "Player path is not set properly. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2.", "no-file-path-config-error": "File must be selected before starting your player", "no-hostname-config-error": "Hostname can't be empty", "invalid-port-config-error": "Port must be valid", diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index 0ebd4cd..932f68b 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -108,7 +108,7 @@ es = { "mpc-be-version-insufficient-error": "La versión de MPC no es suficiente, por favor utiliza `mpc-be` >= `{}`", "mpv-version-error": "Syncplay no es compatible con esta versión de mpv. Por favor utiliza una versión diferente de mpv (p.ej. Git HEAD).", "player-file-open-error": "El reproductor falló al abrir el archivo", - "player-path-error": "La ruta del reproductor no está definida correctamente. Los reproductores soportados son: mpv, VLC, MPC-HC, MPC-BE y mplayer2", + "player-path-error": "La ruta del reproductor no está definida correctamente. Los reproductores soportados son: mpv, mpv.net, VLC, MPC-HC, MPC-BE y mplayer2", "hostname-empty-error": "El nombre del host no puede ser vacío", "empty-error": "{} no puede ser vacío", # Configuration "media-player-error": "Error del reproductor multimedia: \"{}\"", # Error line @@ -119,7 +119,7 @@ es = { "unable-to-start-client-error": "No se logró iniciar el cliente", - "player-path-config-error": "La ruta del reproductor no está definida correctamente. Los reproductores soportados son: mpv, VLC, MPC-HC, MPC-BE y mplayer2.", + "player-path-config-error": "La ruta del reproductor no está definida correctamente. Los reproductores soportados son: mpv, mpv.net, VLC, MPC-HC, MPC-BE y mplayer2.", "no-file-path-config-error": "El archivo debe ser seleccionado antes de iniciar el reproductor", "no-hostname-config-error": "El nombre del host no puede ser vacío", "invalid-port-config-error": "El puerto debe ser válido", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 43809a9..df44bb9 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -108,7 +108,7 @@ it = { "mpc-be-version-insufficient-error": "La tua versione di MPC è troppo vecchia, per favore usa `mpc-be` >= `{}`", "mpv-version-error": "Syncplay non è compatibile con questa versione di mpv. Per favore usa un'altra versione di mpv (es. Git HEAD).", "player-file-open-error": "Il player non è riuscito ad aprire il file", - "player-path-error": "Il path del player non è configurato correttamente. I player supportati sono: mpv, VLC, MPC-HC, MPC-BE e mplayer2", + "player-path-error": "Il path del player non è configurato correttamente. I player supportati sono: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2", "hostname-empty-error": "Il campo hostname non può essere vuoto", "empty-error": "Il campo {} non può esssere vuoto", # Configuration "media-player-error": "Errore media player: \"{}\"", # Error line @@ -119,7 +119,7 @@ it = { "unable-to-start-client-error": "Impossibile avviare il client", - "player-path-config-error": "Il percorso del player non è configurato correttamente. I player supportati sono: mpv, VLC, MPC-HC, MPC-BE e mplayer2.", + "player-path-config-error": "Il percorso del player non è configurato correttamente. I player supportati sono: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2.", "no-file-path-config-error": "Deve essere selezionato un file prima di avviare il player", "no-hostname-config-error": "Il campo hostname non può essere vuoto", "invalid-port-config-error": "La porta deve essere valida", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 2d9be9c..26aadd1 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -108,7 +108,7 @@ ru = { "mpc-be-version-insufficient-error": "Версия MPC слишком старая, пожалуйста, используйте `mpc-be` >= `{}`", "mpv-version-error": "Syncplay не совместим с данной версией mpv. Пожалуйста, используйте другую версию mpv (лучше свежайшую).", "player-file-open-error": "Проигрыватель не может открыть файл.", - "player-path-error": "Путь к проигрывателю задан неверно. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2.", # TODO: Translate last sentence + "player-path-error": "Путь к проигрывателю задан неверно. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2.", # TODO: Translate last sentence "hostname-empty-error": "Имя пользователя не может быть пустым.", "empty-error": "{} не может быть пустым.", # Configuration "media-player-error": "Ошибка проигрывателя: \"{}\"", # Error line @@ -119,7 +119,7 @@ ru = { "unable-to-start-client-error": "Невозможно запустить клиент", - "player-path-config-error": "Путь к проигрывателю установлен неверно. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end + "player-path-config-error": "Путь к проигрывателю установлен неверно. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end "no-file-path-config-error": "Файл должен быть указан до включения проигрывателя", "no-hostname-config-error": "Имя сервера не может быть пустым", "invalid-port-config-error": "Неверный номер порта", diff --git a/syncplay/players/__init__.py b/syncplay/players/__init__.py index 9fb3563..8c812db 100755 --- a/syncplay/players/__init__.py +++ b/syncplay/players/__init__.py @@ -1,5 +1,6 @@ from syncplay.players.mplayer import MplayerPlayer from syncplay.players.mpv import MpvPlayer +from syncplay.players.mpvnet import MpvnetPlayer from syncplay.players.vlc import VlcPlayer try: from syncplay.players.mpc import MPCHCAPIPlayer @@ -14,4 +15,4 @@ except ImportError: def getAvailablePlayers(): - return [MPCHCAPIPlayer, MpvPlayer, VlcPlayer, MpcBePlayer, MplayerPlayer] + return [MPCHCAPIPlayer, MpvPlayer, MpvnetPlayer, VlcPlayer, MpcBePlayer, MplayerPlayer] diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index 776a9a3..622d296 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -55,7 +55,7 @@ class MpvPlayer(MplayerPlayer): @staticmethod def isValidPlayerPath(path): - if "mpv" in path and MpvPlayer.getExpandedPath(path): + if "mpv" in path and "mpvnet" not in path and MpvPlayer.getExpandedPath(path): return True return False diff --git a/syncplay/players/mpvnet.py b/syncplay/players/mpvnet.py new file mode 100644 index 0000000..5813e37 --- /dev/null +++ b/syncplay/players/mpvnet.py @@ -0,0 +1,51 @@ +import os +from syncplay import constants +from syncplay.players.mpv import NewMpvPlayer + +class MpvnetPlayer(NewMpvPlayer): + + + @staticmethod + def run(client, playerPath, filePath, args): + constants.MPV_NEW_VERSION = True + constants.MPV_OSC_VISIBILITY_CHANGE_VERSION = True + return MpvnetPlayer(client, MpvnetPlayer.getExpandedPath(playerPath), filePath, args) + + @staticmethod + def getDefaultPlayerPathsList(): + l = [] + for path in constants.MPVNET_PATHS: + p = MpvnetPlayer.getExpandedPath(path) + if p: + l.append(p) + return l + + + @staticmethod + def isValidPlayerPath(path): + if "mpvnet" in path and MpvnetPlayer.getExpandedPath(path): + return True + return False + + + @staticmethod + def getExpandedPath(playerPath): + if not os.path.isfile(playerPath): + if os.path.isfile(playerPath + "mpvnet.exe"): + playerPath += "mpvnet.exe" + return playerPath + elif os.path.isfile(playerPath + "\\mpvnet.exe"): + playerPath += "\\mpvnet.exe" + return playerPath + if os.access(playerPath, os.X_OK): + return playerPath + for path in os.environ['PATH'].split(':'): + path = os.path.join(os.path.realpath(path), playerPath) + if os.access(path, os.X_OK): + return path + + + @staticmethod + def getIconPath(path): + return constants.MPVNET_ICONPATH + diff --git a/syncplay/resources/mpvnet.ico b/syncplay/resources/mpvnet.ico new file mode 100644 index 0000000000000000000000000000000000000000..a70ca15629bd4846a7147e7f2767fd06f00cbbb5 GIT binary patch literal 25723 zcmdUX2{=_<7x1~)JcW#jOc_FHP*jR!NK%?eDH@du4N4_05v9^wX%HDIQ_4^w#6>iS zNTDRxP^OA9kLTa(UZ-v%^}XNs|IdG(XW3`idrf=owbx#IUl>Nh*f0SB43#q2c2*2C z$1qG>obl|#g<E{61Pc&cL+}nk`yjwQyn}C0=lccsgCLB`69}3R;3EKhJBa}5 z678Ub=STzt2ypy7f{W}p9w5koiyVx147^Y$3ITzG72N|}Mq6kXISa=h*y4ER5dfI&0f496dz!tvspIG*Q^?tO9m$r(m@*PIy#v>|lG z;4e}W$8%5M`16Z6-dcy_Ei@c2z5Sy-;EJA4@BrmC1m)jpr|dv<5UuBzP}?dTugb#l z=1Lr|FU0Y}YYaST4u}UX0td8hqqhfLfvmtgw1;*DR~RzXKE?5l&xn^hIG*K(WsE*%*b&ixKid!BxH$#KlWcH2;{bw#IG(&2@irZ`Wg}>V{eaCu+u`jO@Lb_z z0NjIoKkOH5ov>eG9KbW+9BuqSo$qalfr#D#p1&TyG!6`-vS1j6L|_`dgu2iM+Jc`! zt_nl$i0*&rt&z_f$N9a@; z-JeGQc={0#eK53yZ%_y7PC`I${~O#asE!4Kw+M#f8toa{tU&-ce!Ad!@cm9yHY4~M z7ue8nFtpwUtOd0N9N%f6dqO8b`)AyM6KwRFBx8KVE=J?X1oXK1VkN1d2Kw7-?zf?Y>yw~k?vEGKX~Mc#@a?450OE2Nk6w^;3E11WP$$q zxz2SJ9H$;)_?@T!Fv{FPe*r!Nd=Ajca%GI+q3szs0rxZn)!*@hyr2*2;UBmgi*X#F zC=}rZ8ccNPG>~r%oya`afmgr@xWR^h*dXXT5$S}k2ZRUan)W6f#|Ln{`x}l|XEXdD z_&mBCNEWF3U>mdl1pI)L7&{Ez0Pn#QkZzALweR{ayJG$NRc*yz48Xah*W}=4k>KqXgVT@S}O+xA>7v zFy}VCX5a_C!Mp}-?yepV|Ihk~(n7od??d(6>H8TpKz@jG>R+I^z{oQF}`37pJSrS;2}g7(b)Tg#uMZZKwsbcX3#%SopJp7Bxb&ed%#Keqo{=W zr0f?OSA|h*VaA9z>Ejh>4AKF=1NImsPT*rM!B-Ogjqsx|ul($v>AEE2IM9LE?_*W5ja)sIPw33DEe-Kf^?W-T{Ctc7xxUd12fG9%lH_kIZ#{nO}&BjEM%w@#|bL zJU(XJBhHUQXn-vL$@~s&=(-^AjZ_ZS`>(_&eV7i`g-K&Hj02-$EOelti0N-HXhXCI zT!0gBLmVc9KoP$cY zZT{m6+9Dt!P(k30;1z;S1kAQE+)EI`ZgSBgb0AnpSIzPa}FM1fH4}AnWA3<&sq9?-ev#|bybzl~X z?*Jg)gtacr(?JrbJ@U;X;-U8i-5y|Y4AO=YZ0*N<%iJFF6yW0__9Wt0`g}snE2xC| z5Z=N30`b&k-r?o|;0tJgO)}F~L(en>zw&(r>G}Rzgd65agdgU2`kcl*XQKI-dH#g^ zmI> zp91v3R}~Li=aw#_$t35qb0|jshyosTwbe6X9*9$zV;*K6fZw>K$Xshp{Mrvd6KI3a{#i#* zH)a7t-vn(a3Hm*4I8IB)@oygxF9SH<(~je{Pf(v+`BfLt4++bE#{YvJ(1v;A=kJhL zfxe^LH1zu*5cFX^1pNGyKA@eE_t7j_sfh^nI4w z==2HO1X&@DeR~)61?n5PKo_t+0lp!|AKnIt`TJ+xfS>zY`mnB`>j23QYYkY}(AO}d z(*ITeFlNEO{)zr!%?E2ISU151zas}nBOtRD&$(2ZI9XhV7z^J##rNm%rFiiuT0n15FY^a zVeLG0j4_^J{DBYn)&D^LIK$~@9T4LWXu{RofyO;re?xwoIWO^@Z=`#ek6>;3tL_Q^ zGqV4s=g)n9*a7(8Z?z2CkPnBP0-e?nnZMIV?{6C**-696PxxP$1C9@?AAjVBAV*Bc zhh%}WB!*#c;CqIZ8Py@`-(Sa^n;*&p&?M$Rh*N39@&LL0xFu)|do%iCwD}kM8~D0s zf#yEGp)`qSpanDu`cNK3FnqiT;~{)1!;S$r(4Yg-3HTl28T=8f-ytUtdo;t_9K;_G z>(FU4#Xt}f#gEX2VLuSl+*D`eTT*v1>@(v4;>#Y%Yl-6#Gf^zaKN4NyJ;Zq5<1Z%q zzz@XTc_Z=w^3d%V+0!K?AMgV@rtc%6cfZ;=L6ayUw*9`o2inAi-V=Q>V^ki7*DFC| zq!MUDZ2w*F1Z|=uzM)bX0qALXd-yy0#QI}cxe3}t$;5*ox(A#5x9cykHF|#o?mxYt zE`tBY`V(;c$JZbq|FiWsP9fm~80OZ8VLDwHCf$Nz{4@;Xpkf#c00pHF0IgT92lFgXOP5S%~|i{J%W>~`i@+CnJl@bUn5!^%o`=cEQMjGQo-$Pw!6OI6I0IvV3 z90Yz;!n}R}!Ak_a2!`_Zx6gnBZ~;!h{a=-Xz=uj+1RD_mt>M?>|4tUb39-i}1bhho zwHyQvR4O5eM9_ucZ}t1P^}7*`CDtC8@bX6&)Eflgy%E8GN}Cb)KYx(( z?eFwX@CiAY%iN5$cF;JqK12ZfPghV(2k|aZ@9*>i{Qx|TCP6w{gktsm&?*1?ikPry6auLfCQ9}fEDkLl6<65Y2l4~9YBK`!vUqx(qE z+a+Wpkk!a8SYPU8Do6Up?;J(2<1Jn}+0uoaB6Yk$@k;9EBn{1P$@K1-t#`e<~0 z!2V#8&5!lyFZ>P1^KkD5`v%Tx1o3z2%YZ;9<--XYzk<= zcpg44&a7kL8F+`aP{)Y;gYM~PP)5-GQ2rr@UYXA550Hhp;0z3n%E;}HW>av6^Crqm z{obbn&%nFSh`fVM0gmDJJebEJv;N_H5wQnRmGvVR3vz%>ft}Iw&}htzWK+-wkf$3y zKgrw&z&os0ncw|<54MwJGqUXr)j#n6(;h|$%HJ0=a`!}E(9aCL8vcA6-~;~C_c8Kd zzvJ!4TKi|7ncF}v4PqDid7L5sg6M;x`Un0A-w8Sfen976YZ!e%$iaMmj;K$^iRLxf z9~(YD&CDy2Ct!Z};~s1WVn>J(hVwgr!aq?5Y#wsUw2U8n8XyOZ5yS+8E`I-Ma z`~!dBM~OW>f`2&gM&H*%-@o@4@UQkK{6ilM&p*6}SS|DDztcbP{e3^|3&AyGpBTx6L^O)F!cS8XNY+o?)iKFL+1zdi2!UH_S0Zro4DxbA<_OG zjD2Riq3a*UFJ+{?y&t?Wcpt@ol2J^8_G`e05Pdte9M1oMox{Eq%w^zHiL1XCofR!% z*wHV15BfKt1$!4ie!s!YGxI(0KKlFxziAoDGxPH={9i$52W~Ka%K>v1alv^``ab$_ zIv?a6@B;sE&hdA4!T1Ke|2}@8j{y|(!*6s(@=N+<#6WL@~sXa3$y- z&LNGw&qnkM@C>|<9zR1Lz&r+LABL0R7ygkD5O+d9&|?WEzc?Jv-`}Be3+Md9ltF=PLe0e+(Xh*Y6kH4}uLUN6%jY9mt!(8VTlR(D~oULC?h@-oYP4&l}w5 z{)4_}@CG@y@46?17<|WrO4yV7GhIM@3TLuleFpO-aTWq(83|zg!}%3B`vN}gPiZmg zMWXtUJKV6|hIk9kXhIGb&IZ963IO^D@||$r03^1m_Fa4Qs{daNz4e&F+9jgS7qm>8`-R@8czSRZ+=;eR8e+_%&bRUVz z|Jnt(2I2p!^8-T_z$6F6PY}1>L;$(ek#nfO+7r};Hei#0<9jSNl-~d98PO#A1J)06 z2w)v|0s*W^Atz9YfXL6l{r}|r42~l{0O0TtlyH~`N-8>F1SJKXAA%AT;fA5#K%q=r`;{Nr7i{>WL`f@&DyT0pd*jP~n-0Um83! z$wSCV$URgagr2_ZjXJ1DLa&6LQAN=E3A3d}eB2V;hzg(aBK;L~W)MT1?C6cv-pFl8 zyD`T43syP5{T$@BYjvrAv(97jJ6svNTu3a6?z%qb1za_5@D*=y93SneGDB|l+e=Gc z8ixnei&S(xjGFEr9(^r3I{NK$>sR%wElz6$J=HhfaM^g<@lr#DD`#_;)KfK#r;VAo z)Q&2vsMY1cC!Snd7TEcCeyP=XJXxn;cJHU7B}NGtPi1Ps*Y%ZmJKi3-{UP~|uZ_~u z0Ev*yUR!xHzE_8>U%&6fQYZ^TUi3<|rE?U14u8^^E-EW7DTuW?zFftk%AI~ky=$)S z*vk#Ai zN}6&CE@YL_)7nwOa+PvgcZS*Za>d|!jsq;I6j9Bb4HfKM+=AF?tsMboXIw9J+TOOm zsu#w;owR}FK+2@IPUD3w^fA3hJPobOx>6qmhWO5{P+s87CL+7PahCEFAB^=>=LI)` zWd8ft#1tchoCTc=OpBt+#jgsII58zt7Dt_ysd45>^NtsDYjf;6zaRhE8 zcVwK{zOBJ@o51}g&Jtx`!s|5z#(Jh*XJkNaokY1{v4<@g{^ zHe=u5gNv&?cZg~E;Q6ecoJjIZos{AAttmD9+aJy=VgUF10dc(wzO{ zH*?Ej2DI4&2i?8T-aq*?$8OTJ(~`g`>;B>LOdb02Vv3vzb!v zR4yl;xnb40mdO>zSx>(v(-gV~*!^qIAJf*G#7ka=RmRVjh%?91Jc4Y^Za(lZo8myS zPIStPTbx8%K)dmV_0z&Y>&U=%>U^c$bx~%w@w;<~)oAc_I%iNzNOHwQzwa%&T)7!rt>(JWK8n*m8 zE494RO=Mh@g1+As>aC>#z5B6hq z`}AH#vAce`kzaP@WE!Tm!xifj-s767=30BBJIY>OQ9dCRdp`kxaW+@V<4qc;w!rI} z?0ej~w{?v@ltaz4Ae+Y5cqxO&(J$Exo_@?9;TZE9*ZMM~7^j6LXnu=E}A=7o@xxe_`GwAi^A&TsSRsRe**6U@o@Uo^(Uv>q|LB`TecQ$@ep-{spN#SFWt3;yPL^+z^lNHp1 zXdr8owME_^J)!uN)nyJ>a8N{+RjBsfg>exa9ozIdDYxxUD)qZ8utrW`B~PEbcyLFa zcdwfUzgM9dh)05W(Ryu53wz|_PZ>&@B z=Eaj$Wb4PL8(67bxv{aoHv*zIRm?VzSm~V70mlt+~~i z?&&wNyG^iWVioBXDfFa}hwEfg`hw?yI#(z!G^y81Pqa3L?HJS7>EGBXaCd8_3N5zZ zIrOAF7W=$Y>Q&D~(TPGWUS5tS5A97nwH<;zE&Lv zt$KECLRtHX_J4FOm+L+dq`Y3{w#PNKY^u8GKh%SH-J$2?F{ONN+B~(}?P7IFVtMlJ z3tl~-oLS)-8OTXXUDMbXGS;=a??A%FYZ=Ao&w#t8@qsp!Fwfh>LW>p?sGl^_zV;OI{aIqy>`}oZQ-2Y~g;{bl3 zrnZ1TZo8;<8v85_kL%^z7hbVo;a9uAcedHFZ?D6YRmd%k{eIZ#l-Po0=eWw!*5tn{ z&X+Qw75kdt4}|J$>IAjk$M$kR-{PkJNo(8siG^M#$%>!F%yzLBp4wW#uOctWRu{a1 zFG)?U*|zQlrPskjCtV_Zk(Sx?osBW?#%-Bu6r#s%*GT+vA;XfR{-OJ9qehSo>NfoWIs8M>#+V>`*zO8v@%Z@dR`uF=A zb@i?A|15fPbC2-qkGrpMzN_p0;wjuZ?E(L57b^ETuH>D9R#Kq}@8<;TI5$bq)Jv%M z@2A8*m%RAgtXsxc-$wD-L8TkwBxRKgQ@vh0#o6DnS2f(b8k_vcR)O|jF}Z1N)D|^S zo>tQNo-dwc+UNdtGiWoe_!z!aUt*r`9edlWNlx+b@~stCx56l<*ZBSNwg^)D*X;l1 zaP(oLxRB-YpE>B`HQQT6szkPPRr`-jpN47ETfU#Cky4!1mc}aHmtt!Py z2LjHP*R2y_TawHxZh@rXrJ^&ZotUk1=AmWoT=b5Iw&D<2t&$jR4GAEjs8ml%xU87+VBxjXj zcG8!7$7Op{;lkSPHjz_eq&4yFmzGd(cWl|uax;Z{)&>^-3f|UD$t$N%82`~yi0xEE zaSa#Mu%e_VvvJPqj!D8V`o=A0onNk;V}Lmo$DAPNwl#cZrP)`Mn4i?{&x?5GUM}%E z!6tO3H#P6^IpvUKPHOpdA2ZvuZ)YRiKD=6HaWgl+^igW^6ZCCQ%x7x6>+SrM$+s_P zZ5_CKKG7xel!{TiinG?oo4FSy1??yFpN?mxO{p+9UmQ3cUzQZLEp)+*2t$8~$M=)B zhf2*QTXZG*3sPgEQYLfy4UozP=J%zr6j<{P^qc2f6zNKuoURM7HY(EY886RDHNHC` z^7Zbm3Xf)XcWz)G*rVg(IK8X$*(C}5sngd03!BW$khL!!dykVMiD%#$DNBPsoRJq} zud;BXxb5`5E35Iq%97tN#{KHKlvr)aaMSorKEk%^!Tbp~b44ez7aj<4-Qd`<0fntyi7vgWJ?0d^m?*p(05 zUthdrweBo$+QSyhj5t7}(FvxU~{27X4@H$@yu^w z$uPrC-ONl-ySucYmS$aE^kWR_-|M)4;m$TM+5GtT79(f zJIS7bazPQoloGXuo~7nCl*DX78+jw*i%{KK4mi%;8{ zj}PKVo}lJ~dD6PGCv|z3w4C()b~CqlV*L1t2h>QOj!(qIye#ed>gObvyi?lsYMd;V zJAJNUg!~|k2-eVfj)(*1Wf#h?p^b-l(+SBt}hi#@7~jrV^ADUwXpZh&$~V| zZp%~N%?37#y8h>9C2=4j+qb=U*(tuaO6N@Uikhh>eeDA|tTPnm)Z}dwPebdUsHiNO ztjw*Z=WjI=uhjHMC)evNRGxV!>bQ}aft zk(0u}ik175c;pv5i5%xA3x?%ik?dI$9xfNp|PQg*VJubveBfg{q!U z3-qUCtl=?k;J4(xpTH`hCm%EWcyV~-e9zOl*X+4Y+ZmI&LxoBtvtOteAHDfc#PSu2 z9->*7H)}Z z(K_~8H^W}l(|P(%2^agQ=nkHfJhE*wH7=*y$y_hzmff(56uiT8nL2j|t$?PWC8GBr zA+znNXo!G{YGX*Zgp;S{_Awov#d(D`?6=&PR+w{kth{PgzBkV<`%s3vtaH=m3Ja-2 zDHF*8mtv0?yQ8p48;@39~lbK2vu*=Z$2a$q}vF&(uOv z-5-IJq+>OOwUPZ|V`Aj0>9f1)B{jxrSrp8& z58ybc<~~k#!ozt%UKja87hY$XFgJF-H~Tpfj|z$JVRuQK&GCSiROLtAr;c5s9hA;) zJ`)vwW6tcYU3Kc}Sdh3l2@Cw^=!VG9G~Ls7q8?SzQ7V~9cCN|I<=5QT8?9CfRetI4Weny#KltF) zF%=~jOcXi13$i43@O+*-#?HiH;pXHj*N@t1B~gZc23N9ePcPN;TSFFC#X=G{>0^Cc zzpBkVq%^LY^UkLb3AKdS@>7l(O=$Bnrg@f^wt5eh z%eh8A>OIei1DZK9r?fc=-9yQRB|HabMc$qisx7%Hv%psL)}54%MHR7zr=>MxCYv63 zQs0g{KC+%yqG>9B{#eJ11YYG!H}{1cikg!xE&67GbB%J^zN}M@ZW>aeG5E$CnD|2x zG z#W$*v99Qn2y<Fb>pPle9`3Jf4zGWP zZ*Kc~Mifoxq8IZh8Xn0WQL9z%y5(g#X7}Hj5!dPy6m%$Io9~-1S#GC9DeJ}6u-y+^ zq8=2=oZm<~I{Co?DX&hJYrPS^UwCr8@lQN=&a{^mu$Fp zZ+AiSvT;%a*~-$=vY7qJhf4$IhnOe%e;8Z0aKW5)d++bhnlx^@m{ZR?;Uhd5)67p8 z@x&P<-TZLwY35a>s*ba&rTh0ST;bKbXXjH9Md`q4^ZOje(SwDVyrP(o#ibCo8LtvI zZ1!2{$e|t;I{t`!;W^bMygL0H&ytL$Uc^4V+P(GWz4qvp?!F6SwiM?C-#&TJ*_sUTp2$R%QMEn6;~bP8~XZj@&~*OJltiS?D2;Fub&^6YTD!!XKameIHQEc)+Z*eKtob}++lOU&*Pl! zGVC&?BJK}tAGrItD?;Z~O>xc4!*)fxZ%f~6&$2ydrru6c*z?V!k$OaZPK>{Y`|4(jZh%Q<(9u}*qX+M$;xBXpL~ z@@lv#SHncMzux@-p^9E=)~&Xl~2$?$GJqxR+GM9(^>f0nzOBv{!BW_SLfekz4yz ztGMbU30{Z5xZG}z<@2?t2ys(NXWuaBT-}wkPO0XKfVP|9KtK9x*7McWP%&a@zonkZ z#?Ih)<#40t#VN5_>eUwo(rUBHAFob!Fwsd5iKjhrkUigHKTW7Ik)>bPXU4{3*Kb>h za2Z5-b#?pNVG+S)@6M?zcXX~j-^KFbZn;wLvh#+ReRQ(ebgw024oI%t#~S7lymC*$ zM_Q>A3eQfqUefDiYkv?|-;hz!TER6b(e%d5Jj^Vk)^?0h#LC^d9Me*2qYqdu`|REM z$uj%6o;~Nl*R!h&_zik?#ghxkLP|nQkS{2eThaEe=fvAf>X-PJ-Kt4V)k#Q|wl+&E z*&Wm>7L=yG7)vt_D?iztp;%PH!yy;1&b9YtpH$1Gl-NRtb6n1CDcdjbsRwdhwNRcWp5G9t zQatZnMET;@hVc|7ow$N-l517C^Sv_MDjJKy-e14>B$M+TS68qmwaw?AQ1EO%iEY$( z4UUcE{lP0u*h2RvENppn#C#4e<9O_9iuS;f>5C;qKRj%?n-V*nbNX!Od2+@J%nIHY z-AehozwKme?^B0QCOsbxB?{Mhk7c7?uW$F-fvk7J>}j?$j~tF!((_@`8%+~YOf!e1 zHb;EbB1MkW`GSIR{`2NFcJ6E_c1x|hs<8Y^T3K^b`rD8vzSQ!IW0Fp(It1T)+a0@Y46`!VOF9f%Q2VpuT5wQ zl2&QSNnoRz7I_#vBG=C66VAY_`gOnxlo$o@*NsVEun&xgXP>ys3+oZGfkHP78t)rG02PMT%$jqGoT zVU_wpI*HeoEcHJ<;oOvze`+1wVghw|cHM3>P!Yu(s-N&XRi2J}QoHJLnbv*L8SecL zTV4dk?{TF_pV9mrA*`~2jFO_!?guG~6$cg6&T*|-&k-ENu`j$KQ87L6L1fCjr1sor z-E%2dD^`8@CrO=*p|m#phSDR}SxQ$Z>eeiIwhf6BT_wNxRjkx`u}w24&o%9=1JpXi z?!2gUeUZU@iR8Pav4T;G_pZ3hmc5Zmjc~oT+x{d+-{EN)Y$2r8Q>?}h94+$GXUP<* ziI^X`G(&SqNmGV!Um2Ttu4xgUi_)jmu_E8NvaF?#weH5MPgRoZj?LAGgpd9xTF`UmrY8aiwPDzvMcSP#i2?>IB? z@w%d8o1|pD&|`I)vF7UT(BOE^63H`$F`lvGV1KDJ89u>>z}JAd-E)GjN@OrC8xn8#2+i|_wtm( zWV$JPpZYGy7Zw?(zwvOs@p`ycBN#THDkl5#;yBkO`+*gIl?E&x(oSUDXc1$)44Q8 z?085ox$R>}s?1ao+fIM8l76px0gA+``8K;F9VBNM@+`dRbDd+Us_gAv9&X=@*@Cv~ff=hGU+rBx#)|vBSjYuy+CpOt$jyhTU6O@BV!DA7JR+dN}&2t(!&?&=J$9o z%GGM)P4A2s`AF#;Sg9Ra&RKYwRkBz-YMj8QIx+i`Mo#1ZQ5q|#J3%uiN!M-7L{3t? zlyrD^m+=i&Y7NOI!d{*=)Aj(1b$e=r^-cYySlamg>T+a{d7lh-ceXdp+M@9f(qOaU zZo`W#9^Jc?!V35WO~_|E@j z%Z1dHk6cP90*Ba_d%IjK+`VX;xI9?z5i>r68_fH?IpRyub?Gd!=DO|ZIZ;z~GkGoO!r}yK9%{ejN7gElo zar5O^O;lU9o)7Nv5>I6nKYcY!$Z{-a<|daXIubkOD1u@NCge=(7_M%k%{MWM8W(Hj z_MEV@ZW<+OBtv=hi6e#wecH`BwOX$D9eW?|33ktFElPCtjK)>gv)7C#30H@g`JQA? zBp*%rEGTE96FvKLik6nnqlskkJ()Ws%x>oJHzXSP2$!3!c3Gdo$92Api`wFKD=aLS z<<|akx$QSuy27tkZ>>09FC%I~iEq(MbBa8xe(rOCr|wfS&XYX*P67Y4GnnB!PmR-& zTQmESLiDP(t~wXHGD$W?kfcmCF6MRNM`;#c0nW+P&I;kdy}Qk5^Ursz$7EFBrAmRe z2aRAs(q#%+HkqTrV7pxT@@0MI702~O1SxWkFJrKD-?wvwWqoEHquz~F8X#5V>Prby z#L&VToU_u_qci zm0a6_Hd-l3`pMEF<52d`uj(H81*yFHz)~GveTr1&eoM;oYxb+0ac(=)%Bb>?WEpaZp!%Hc>|eeOAZ#lawS`I!%(RKn ztT!m6pnYT{Zrxtb!c+5X`Fh+ds8e1ExyITbWA#FxzFy=trE=2_H^1n!5I#8W?eg|^ zDXMI9<>zy0zEk8d_Ua%VW#MCbd$2{-_!UoAnVSBi_s$>0q!OeZCdgr;H9@9NlqAM4 zU%v2m=j!|qD^IPDJlZk8d1qno1l^>oa<_WddfIg1JR(!9)=%d6fT7FSV5$BcJsXez E1A0)V&j0`b literal 0 HcmV?d00001 From 0f284e7329eed6a86ecbfd9a2d3a3c392bfbedc3 Mon Sep 17 00:00:00 2001 From: et0h Date: Wed, 7 Aug 2019 22:26:22 +0100 Subject: [PATCH 014/112] Make mpv code compatible with mpvnet --- syncplay/__init__.py | 2 +- syncplay/players/mpv.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/syncplay/__init__.py b/syncplay/__init__.py index 08032d7..5132d32 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ version = '1.6.5' revision = ' development' milestone = 'Yoitsu' -release_number = '80' +release_number = '81' projectURL = 'https://syncplay.pl/' diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index 622d296..c27a684 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -128,7 +128,7 @@ class NewMpvPlayer(OldMpvPlayer): def displayMessage(self, message, duration=(constants.OSD_DURATION * 1000), OSDType=constants.OSD_NOTIFICATION, mood=constants.MESSAGE_NEUTRAL): if not self._client._config["chatOutputEnabled"]: - super(self.__class__, self).displayMessage(message=message, duration=duration, OSDType=OSDType, mood=mood) + MplayerPlayer.displayMessage(self, message=message, duration=duration, OSDType=OSDType, mood=mood) return messageString = self._sanitizeText(message.replace("\\n", "")).replace( "\\\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER).replace("", "\\n") @@ -136,7 +136,7 @@ class NewMpvPlayer(OldMpvPlayer): def displayChatMessage(self, username, message): if not self._client._config["chatOutputEnabled"]: - super(self.__class__, self).displayChatMessage(username, message) + MplayerPlayer.displayChatMessage(self, username, message) return username = self._sanitizeText(username.replace("\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER)) message = self._sanitizeText(message.replace("\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER)) @@ -252,7 +252,7 @@ class NewMpvPlayer(OldMpvPlayer): self._client.ui.showDebugMessage( "Did not seek as recently reset and {} below 'do not reset position' threshold".format(value)) return - super(self.__class__, self).setPosition(value) + MplayerPlayer.setPosition(self, value) self.lastMPVPositionUpdate = time.time() def openFile(self, filePath, resetPosition=False): From 4765fa452caba35793003e48c953ddfddd7a05e0 Mon Sep 17 00:00:00 2001 From: et0h Date: Sat, 17 Aug 2019 16:33:01 +0100 Subject: [PATCH 015/112] Seamless advancement and auto-looping for music (mpv) --- syncplay/__init__.py | 2 +- syncplay/client.py | 24 ++++++++++++++++++++---- syncplay/constants.py | 1 + syncplay/players/mpv.py | 4 ++++ 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/syncplay/__init__.py b/syncplay/__init__.py index 5132d32..d544005 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ version = '1.6.5' revision = ' development' milestone = 'Yoitsu' -release_number = '81' +release_number = '82' projectURL = 'https://syncplay.pl/' diff --git a/syncplay/client.py b/syncplay/client.py index 8a42bc8..1df4acf 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -199,9 +199,16 @@ class SyncplayClient(object): self.setPosition(-1) self.ui.showDebugMessage("Rewinded after double-check") + def isPlayingMusic(self): + if self.userlist.currentUser.file: + for musicFormat in constants.MUSIC_FORMATS: + if self.userlist.currentUser.file['name'].lower().endswith(musicFormat): + return True + def updatePlayerStatus(self, paused, position): position -= self.getUserOffset() pauseChange, seeked = self._determinePlayerStateChange(paused, position) + positionBeforeSeek = self._playerPosition self._playerPosition = position self._playerPaused = paused currentLength = self.userlist.currentUser.file["duration"] if self.userlist.currentUser.file else 0 @@ -222,7 +229,9 @@ class SyncplayClient(object): if self._lastGlobalUpdate: self._lastPlayerUpdate = time.time() - if (pauseChange or seeked) and self._protocol: + if seeked and not pauseChange and self.isPlayingMusic() and abs(positionBeforeSeek - currentLength) < constants.PLAYLIST_LOAD_NEXT_FILE_TIME_FROM_END_THRESHOLD and self.playlist.notJustChangedPlaylist(): + self.playlist.loadNextFileInPlaylist() + elif (pauseChange or seeked) and self._protocol: if seeked: self.playerPositionBeforeLastSeek = self.getGlobalPosition() self._protocol.sendState(self.getPlayerPosition(), self.getPlayerPaused(), seeked, None, True) @@ -230,7 +239,10 @@ class SyncplayClient(object): def prepareToAdvancePlaylist(self): if self.playlist.canSwitchToNextPlaylistIndex(): self.ui.showDebugMessage("Preparing to advance playlist...") - self._protocol.sendState(0, True, True, None, True) + if self.isPlayingMusic(): + self._protocol.sendState(0, False, True, None, True) + else: + self._protocol.sendState(0, True, True, None, True) else: self.ui.showDebugMessage("Not preparing to advance playlist because the next file cannot be switched to") @@ -527,10 +539,10 @@ class SyncplayClient(object): self.playlist.changeToPlaylistIndex(*args, **kwargs) def loopSingleFiles(self): - return self._config["loopSingleFiles"] + return self._config["loopSingleFiles"] or self.isPlayingMusic() def isPlaylistLoopingEnabled(self): - return self._config["loopAtEndOfPlaylist"] + return self._config["loopAtEndOfPlaylist"] or self.isPlayingMusic() def __executePrivacySettings(self, filename, size): if self._config['filenamePrivacyMode'] == PRIVACY_SENDHASHED_MODE: @@ -830,12 +842,16 @@ class SyncplayClient(object): self.autoplayCheck() def autoplayCheck(self): + if self.isPlayingMusic(): + return True if self.autoplayConditionsMet(): self.startAutoplayCountdown() else: self.stopAutoplayCountdown() def instaplayConditionsMet(self): + if self.isPlayingMusic(): + return True if not self.userlist.currentUser.canControl(): return False diff --git a/syncplay/constants.py b/syncplay/constants.py index 7f0fcf5..7cde152 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -30,6 +30,7 @@ UI_TIME_FORMAT = "[%X] " CONFIG_NAMES = [".syncplay", "syncplay.ini"] # Syncplay searches first to last DEFAULT_CONFIG_NAME = "syncplay.ini" RECENT_CLIENT_THRESHOLD = "1.6.4" # This and higher considered 'recent' clients (no warnings) +MUSIC_FORMATS = [".mp3", ".m4a", ".m4p", ".wav", ".aiff", ".r", ".ogg", ".flac"] # ALL LOWER CASE! WARN_OLD_CLIENTS = True # Use MOTD to inform old clients to upgrade LIST_RELATIVE_CONFIGS = True # Print list of relative configs loaded SHOW_CONTACT_INFO = True # Displays dev contact details below list in GUI diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index c27a684..68beb0d 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -197,6 +197,10 @@ class NewMpvPlayer(OldMpvPlayer): return self._position def _storePosition(self, value): + if self._client.isPlayingMusic() and self._paused == False and self._position == value and abs(self._position-self._position) < 0.5: + self._client.ui.showDebugMessage("EOF DETECTED!") + self._position = 0 + self.setPosition(0) self.lastMPVPositionUpdate = time.time() if self._recentlyReset(): self._client.ui.showDebugMessage("Recently reset, so storing position as 0") From 51cc57ce032ca37813799981426ae53064033494 Mon Sep 17 00:00:00 2001 From: et0h Date: Sat, 17 Aug 2019 18:37:17 +0100 Subject: [PATCH 016/112] Load playlist from file (command line argument + drop) (#232) --- syncplay/client.py | 18 +++++++++++++++++- syncplay/messages_de.py | 2 ++ syncplay/messages_en.py | 2 ++ syncplay/messages_es.py | 2 ++ syncplay/messages_it.py | 2 ++ syncplay/messages_ru.py | 2 ++ syncplay/ui/ConfigurationGetter.py | 7 ++++++- syncplay/ui/gui.py | 28 ++++++++++++++-------------- 8 files changed, 47 insertions(+), 16 deletions(-) diff --git a/syncplay/client.py b/syncplay/client.py index 1df4acf..36b86ed 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -520,7 +520,11 @@ class SyncplayClient(object): return True return False - def openFile(self, filePath, resetPosition=False): + def openFile(self, filePath, resetPosition=False, fromUser=False): + if fromUser and filePath.endswith(".txt") or filePath.endswith(".m3u") or filePath.endswith(".m3u8"): + self.playlist.loadPlaylistFromFile(filePath, resetPosition) + return + self.playlist.openedFile() self._player.openFile(filePath, resetPosition) if resetPosition: @@ -673,6 +677,9 @@ class SyncplayClient(object): readyState = self._config['readyAtStart'] if self.userlist.currentUser.isReady() is None else self.userlist.currentUser.isReady() self._protocol.setReady(readyState, manuallyInitiated=False) self.reIdentifyAsController() + if self._config["loadPlaylistFromFile"]: + self.playlist.loadPlaylistFromFile(self._config["loadPlaylistFromFile"]) + self._config["loadPlaylistFromFile"] = None def getRoom(self): return self.userlist.currentUser.room @@ -1708,6 +1715,15 @@ class SyncplayPlaylist(): filename = _playlist[_index] if len(_playlist) > _index else None return filename + def loadPlaylistFromFile(self, path, shuffle=False): + with open(path) as f: + newPlaylist = f.read().splitlines() + if shuffle: + random.shuffle(newPlaylist) + if newPlaylist: + self.changePlaylist(newPlaylist, username=None, resetIndex=True) + + def changePlaylist(self, files, username=None, resetIndex=False): if self._playlist == files: if self._playlistIndex != 0 and resetIndex: diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 4d1837f..e415256 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -173,6 +173,8 @@ de = { "version-argument": 'gibt die aktuelle Version aus', "version-message": "Du verwendest Syncplay v. {} ({})", + "load-playlist-from-file-argument": "loads playlist from text file (one entry per line)", # TODO: Translate + # Client labels "config-window-title": "Syncplay Konfiguration", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index b51ad1d..113a780 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -173,6 +173,8 @@ en = { "version-argument": 'prints your version', "version-message": "You're using Syncplay version {} ({})", + "load-playlist-from-file-argument": "loads playlist from text file (one entry per line)", + # Client labels "config-window-title": "Syncplay configuration", diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index 932f68b..1625574 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -173,6 +173,8 @@ es = { "version-argument": 'imprime tu versión', "version-message": "Estás usando la versión de Syncplay {} ({})", + "load-playlist-from-file-argument": "loads playlist from text file (one entry per line)", # TODO: Translate + # Client labels "config-window-title": "Configuración de Syncplay", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index df44bb9..23f8d77 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -173,6 +173,8 @@ it = { "version-argument": 'mostra la tua versione', "version-message": "Stai usando la versione di Syncplay {} ({})", + "load-playlist-from-file-argument": "loads playlist from text file (one entry per line)", # TODO: Translate + # Client labels "config-window-title": "Configurazione di Syncplay", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 26aadd1..cb9b026 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -174,6 +174,8 @@ ru = { "version-argument": 'выводит номер версии', "version-message": "Вы используете Syncplay версии {} ({})", + "load-playlist-from-file-argument": "loads playlist from text file (one entry per line)", # TODO: Translate + # Client labels "config-window-title": "Настройка Syncplay", diff --git a/syncplay/ui/ConfigurationGetter.py b/syncplay/ui/ConfigurationGetter.py index 720dfc0..8586301 100755 --- a/syncplay/ui/ConfigurationGetter.py +++ b/syncplay/ui/ConfigurationGetter.py @@ -92,7 +92,8 @@ class ConfigurationGetter(object): "notificationTimeout": 3, "alertTimeout": 5, "chatTimeout": 7, - "publicServers": [] + "publicServers": [], + "loadPlaylistFromFile": None } self._defaultConfig = self._config.copy() @@ -307,6 +308,8 @@ class ConfigurationGetter(object): key = "noGui" if key == "clear_gui_data": key = "clearGUIData" + if key == "load_playlist_from_file": + key = "loadPlaylistFromFile" self._config[key] = val def _splitPortAndHost(self, host): @@ -495,6 +498,8 @@ class ConfigurationGetter(object): self._argparser.add_argument('file', metavar='file', type=str, nargs='?', help=getMessage("file-argument")) self._argparser.add_argument('--clear-gui-data', action='store_true', help=getMessage("clear-gui-data-argument")) self._argparser.add_argument('-v', '--version', action='store_true', help=getMessage("version-argument")) + self._argparser.add_argument('--load-playlist-from-file', metavar="loadPlaylistFromFile", type=str, help=getMessage("load-playlist-from-file-argument")) + self._argparser.add_argument('_args', metavar='options', type=str, nargs='*', help=getMessage("args-argument")) args = self._argparser.parse_args() if args.version: diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index 87ffc77..cfb233b 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -692,9 +692,9 @@ class MainWindow(QtWidgets.QMainWindow): pathFound = self._syncplayClient.fileSwitch.findFilepath(firstFile) if not isURL(firstFile) else None if self._syncplayClient.userlist.currentUser.file is None or firstFile != self._syncplayClient.userlist.currentUser.file["name"]: if isURL(firstFile): - menu.addAction(QtGui.QPixmap(resourcespath + "world_go.png"), getMessage("openstreamurl-menu-label"), lambda: self.openFile(firstFile, resetPosition=True)) + menu.addAction(QtGui.QPixmap(resourcespath + "world_go.png"), getMessage("openstreamurl-menu-label"), lambda: self.openFile(firstFile, resetPosition=True, fromUser=True)) elif pathFound: - menu.addAction(QtGui.QPixmap(resourcespath + "film_go.png"), getMessage("openmedia-menu-label"), lambda: self.openFile(pathFound, resetPosition=True)) + menu.addAction(QtGui.QPixmap(resourcespath + "film_go.png"), getMessage("openmedia-menu-label"), lambda: self.openFile(pathFound, resetPosition=True, fromUser=True)) if pathFound: menu.addAction(QtGui.QPixmap(resourcespath + "folder_film.png"), getMessage('open-containing-folder'), @@ -753,11 +753,11 @@ class MainWindow(QtWidgets.QMainWindow): if self._syncplayClient.userlist.currentUser.file is None or filename != self._syncplayClient.userlist.currentUser.file["name"]: if isURL(filename): - menu.addAction(QtGui.QPixmap(resourcespath + "world_go.png"), getMessage("openusersstream-menu-label").format(shortUsername), lambda: self.openFile(filename)) + menu.addAction(QtGui.QPixmap(resourcespath + "world_go.png"), getMessage("openusersstream-menu-label").format(shortUsername), lambda: self.openFile(filename, resetPosition=False, fromUser=True)) else: pathFound = self._syncplayClient.fileSwitch.findFilepath(filename) if pathFound: - menu.addAction(QtGui.QPixmap(resourcespath + "film_go.png"), getMessage("openusersfile-menu-label").format(shortUsername), lambda: self.openFile(pathFound)) + menu.addAction(QtGui.QPixmap(resourcespath + "film_go.png"), getMessage("openusersfile-menu-label").format(shortUsername), lambda: self.openFile(pathFound, resetPosition=False, fromUser=True)) if self._syncplayClient.isUntrustedTrustableURI(filename): domain = utils.getDomainFromURL(filename) menu.addAction(QtGui.QPixmap(resourcespath + "shield_add.png"), getMessage("addtrusteddomain-menu-label").format(domain), lambda: self.addTrustedDomain(domain)) @@ -814,11 +814,11 @@ class MainWindow(QtWidgets.QMainWindow): if self._isTryingToChangeToCurrentFile(filename): return if isURL(filename): - self._syncplayClient._player.openFile(filename, resetPosition=True) + self._syncplayClient.openFile(filename, resetPosition=True) else: pathFound = self._syncplayClient.fileSwitch.findFilepath(filename, highPriority=True) if pathFound: - self._syncplayClient._player.openFile(pathFound, resetPosition=True) + self._syncplayClient.openFile(pathFound, resetPosition=True) else: self._syncplayClient.ui.showErrorMessage(getMessage("cannot-find-file-for-playlist-switch-error").format(filename)) @@ -841,11 +841,11 @@ class MainWindow(QtWidgets.QMainWindow): if self._isTryingToChangeToCurrentFile(filename): return if isURL(filename): - self._syncplayClient._player.openFile(filename) + self._syncplayClient.openFile(filename) else: pathFound = self._syncplayClient.fileSwitch.findFilepath(filename, highPriority=True) if pathFound: - self._syncplayClient._player.openFile(pathFound) + self._syncplayClient.openFile(pathFound) else: self._syncplayClient.fileSwitch.updateInfo() self.showErrorMessage(getMessage("switch-file-not-found-error").format(filename)) @@ -1006,7 +1006,7 @@ class MainWindow(QtWidgets.QMainWindow): self.mediadirectory = os.path.dirname(fileName) self._syncplayClient.fileSwitch.setCurrentDirectory(self.mediadirectory) self.saveMediaBrowseSettings() - self._syncplayClient._player.openFile(fileName) + self._syncplayClient.openFile(fileName, resetPosition=False, fromUser=True) @needsClient def OpenAddFilesToPlaylistDialog(self): @@ -1186,7 +1186,7 @@ class MainWindow(QtWidgets.QMainWindow): self, getMessage("promptforstreamurl-msgbox-label"), getMessage("promptforstreamurlinfo-msgbox-label"), QtWidgets.QLineEdit.Normal, "") if ok and streamURL != '': - self._syncplayClient._player.openFile(streamURL) + self._syncplayClient.openFile(streamURL, resetPosition=False, fromUser=True) @needsClient def createControlledRoom(self): @@ -1803,10 +1803,10 @@ class MainWindow(QtWidgets.QMainWindow): else: dropfilepath = os.path.abspath(str(url.toLocalFile())) if rewindFile == False: - self._syncplayClient._player.openFile(dropfilepath) + self._syncplayClient.openFile(dropfilepath, resetPosition=False, fromUser=True) else: self._syncplayClient.setPosition(0) - self._syncplayClient._player.openFile(dropfilepath, resetPosition=True) + self._syncplayClient.openFile(dropfilepath, resetPosition=True, fromUser=True) self._syncplayClient.setPosition(0) def setPlaylist(self, newPlaylist, newIndexFilename=None): @@ -1848,8 +1848,8 @@ class MainWindow(QtWidgets.QMainWindow): else: self.playlist.insertItem(index, filePath) - def openFile(self, filePath, resetPosition=False): - self._syncplayClient._player.openFile(filePath, resetPosition) + def openFile(self, filePath, resetPosition=False, fromUser=False): + self._syncplayClient.openFile(filePath, resetPosition, fromUser=fromUser) def noPlaylistDuplicates(self, filename): if self.isItemInPlaylist(filename): From 143df6c999bfba02efcb628907ebed22a121fbfb Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 18 Aug 2019 23:50:26 +0100 Subject: [PATCH 017/112] Allow managed room password to be specified in name (after : separator) (#216) --- syncplay/__init__.py | 2 +- syncplay/client.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/syncplay/__init__.py b/syncplay/__init__.py index d544005..051f38a 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ version = '1.6.5' revision = ' development' milestone = 'Yoitsu' -release_number = '82' +release_number = '83' projectURL = 'https://syncplay.pl/' diff --git a/syncplay/client.py b/syncplay/client.py index 36b86ed..c6d9885 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -645,6 +645,12 @@ class SyncplayClient(object): return features def setRoom(self, roomName, resetAutoplay=False): + roomSplit = roomName.split(":") + if roomName.startswith("+") and len(roomSplit) > 2: + roomName = roomSplit[0] + ":" + roomSplit[1] + password = roomSplit[2] + self.storeControlPassword(roomName, password) + self.ui.updateRoomName(roomName) self.userlist.currentUser.room = roomName if resetAutoplay: self.resetAutoPlayState() @@ -657,6 +663,7 @@ class SyncplayClient(object): self.reIdentifyAsController() def reIdentifyAsController(self): + self.setRoom(self.userlist.currentUser.room) room = self.userlist.currentUser.room if utils.RoomPasswordProvider.isControlledRoom(room): storedRoomPassword = self.getControlledRoomPassword(room) From 7d694797aa799134efbb3f72112ac065e85c72d0 Mon Sep 17 00:00:00 2001 From: et0h Date: Mon, 19 Aug 2019 17:43:21 +0100 Subject: [PATCH 018/112] Add load/save playlist from/to file menu options --- syncplay/client.py | 6 ++++++ syncplay/messages_de.py | 2 ++ syncplay/messages_en.py | 2 ++ syncplay/messages_es.py | 2 ++ syncplay/messages_it.py | 2 ++ syncplay/messages_ru.py | 2 ++ syncplay/ui/gui.py | 45 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 61 insertions(+) diff --git a/syncplay/client.py b/syncplay/client.py index c6d9885..b253d0d 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -1730,6 +1730,12 @@ class SyncplayPlaylist(): if newPlaylist: self.changePlaylist(newPlaylist, username=None, resetIndex=True) + def savePlaylistToFile(self, path): + with open(path, 'w') as playlistFile: + playlistToSave = utils.getListAsMultilineString(self._playlist) + playlistFile.write(playlistToSave) + self._ui.showMessage("Playlist saved as {}".format(path)) # TODO: Move to messages_en + def changePlaylist(self, files, username=None, resetIndex=False): if self._playlist == files: diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index e415256..9207d67 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -297,6 +297,8 @@ de = { "openmedia-menu-label": "&Mediendatei öffnen...", "openstreamurl-menu-label": "&Stream URL öffnen", "setmediadirectories-menu-label": "Set media &directories", # TODO: Translate + "loadplaylistfromfile-menu-label": "&Load playlist from file", # TODO: Translate + "saveplaylisttofile-menu-label": "&Save playlist to file", # TODO: Translate "exit-menu-label": "&Beenden", "advanced-menu-label": "&Erweitert", "window-menu-label": "&Fenster", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 113a780..1b2d96e 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -299,6 +299,8 @@ en = { "openmedia-menu-label": "&Open media file", "openstreamurl-menu-label": "Open &media stream URL", "setmediadirectories-menu-label": "Set media &directories", + "loadplaylistfromfile-menu-label": "&Load playlist from file", + "saveplaylisttofile-menu-label": "&Save playlist to file", "exit-menu-label": "E&xit", "advanced-menu-label": "&Advanced", "window-menu-label": "&Window", diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index 1625574..e216d35 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -299,6 +299,8 @@ es = { "openmedia-menu-label": "A&brir archivo multimedia", "openstreamurl-menu-label": "Abrir URL de &flujo de medios", "setmediadirectories-menu-label": "&Establecer directorios de medios", + "loadplaylistfromfile-menu-label": "&Load playlist from file", # TODO: Translate + "saveplaylisttofile-menu-label": "&Save playlist to file", # TODO: Translate "exit-menu-label": "&Salir", "advanced-menu-label": "A&vanzado", "window-menu-label": "&Ventana", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 23f8d77..ee18fbd 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -299,6 +299,8 @@ it = { "openmedia-menu-label": "&Apri file multimediali", "openstreamurl-menu-label": "Apri indirizzo di &rete", "setmediadirectories-menu-label": "Imposta &cartelle multimediali", + "loadplaylistfromfile-menu-label": "&Load playlist from file", # TODO: Translate + "saveplaylisttofile-menu-label": "&Save playlist to file", # TODO: Translate "exit-menu-label": "&Esci", "advanced-menu-label": "&Avanzate", "window-menu-label": "&Finestra", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index cb9b026..5c0dc19 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -301,6 +301,8 @@ ru = { "openmedia-menu-label": "&Открыть файл", "openstreamurl-menu-label": "Открыть &ссылку", "setmediadirectories-menu-label": "&Папки воспроизведения", + "loadplaylistfromfile-menu-label": "&Load playlist from file", # TODO: Translate + "saveplaylisttofile-menu-label": "&Save playlist to file", # TODO: Translate "exit-menu-label": "&Выход", "advanced-menu-label": "&Дополнительно", "window-menu-label": "&Вид", diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index cfb233b..27dcb87 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -711,6 +711,10 @@ class MainWindow(QtWidgets.QMainWindow): menu.addAction(QtGui.QPixmap(resourcespath + "film_add.png"), getMessage("addfilestoplaylist-menu-label"), lambda: self.OpenAddFilesToPlaylistDialog()) menu.addAction(QtGui.QPixmap(resourcespath + "world_add.png"), getMessage("addurlstoplaylist-menu-label"), lambda: self.OpenAddURIsToPlaylistDialog()) menu.addSeparator() + menu.addAction(getMessage("loadplaylistfromfile-menu-label"),lambda: self.OpenLoadPlaylistFromFileDialog()) # TODO: Add icon + menu.addAction("Load and shuffle playlist from file",lambda: self.OpenLoadPlaylistFromFileDialog(shuffle=True)) # TODO: Add icon and messages_en + menu.addAction(getMessage("saveplaylisttofile-menu-label"),lambda: self.OpenSavePlaylistToFileDialog()) # TODO: Add icon + menu.addSeparator() menu.addAction(QtGui.QPixmap(resourcespath + "film_folder_edit.png"), getMessage("setmediadirectories-menu-label"), lambda: self.openSetMediaDirectoriesDialog()) menu.addAction(QtGui.QPixmap(resourcespath + "shield_edit.png"), getMessage("settrusteddomains-menu-label"), lambda: self.openSetTrustedDomainsDialog()) menu.exec_(self.playlist.viewport().mapToGlobal(position)) @@ -1041,6 +1045,47 @@ class MainWindow(QtWidgets.QMainWindow): self.updatingPlaylist = False self.playlist.updatePlaylist(self.getPlaylistState()) + @needsClient + def OpenLoadPlaylistFromFileDialog(self, shuffle=False): + self.loadMediaBrowseSettings() + if isMacOS() and IsPySide: + options = QtWidgets.QFileDialog.Options(QtWidgets.QFileDialog.DontUseNativeDialog) + else: + options = QtWidgets.QFileDialog.Options() + self.mediadirectory = "" + currentdirectory = os.path.dirname(self._syncplayClient.userlist.currentUser.file["path"]) if self._syncplayClient.userlist.currentUser.file else None + if currentdirectory and os.path.isdir(currentdirectory): + defaultdirectory = currentdirectory + else: + defaultdirectory = self.getInitialMediaDirectory() + browserfilter = "Playlists (*.m3u *.m3u8 *.txt)" + filepath, filtr = QtWidgets.QFileDialog.getOpenFileName( + self, "Load playlist from file", defaultdirectory, + browserfilter, "", options) # TODO: Note Shuffle and move to messages_en + if os.path.isfile(filepath): + self._syncplayClient.playlist.loadPlaylistFromFile(filepath, shuffle=shuffle) + self.playlist.updatePlaylist(self.getPlaylistState()) + + @needsClient + def OpenSavePlaylistToFileDialog(self): + self.loadMediaBrowseSettings() + if isMacOS() and IsPySide: + options = QtWidgets.QFileDialog.Options(QtWidgets.QFileDialog.DontUseNativeDialog) + else: + options = QtWidgets.QFileDialog.Options() + self.mediadirectory = "" + currentdirectory = os.path.dirname(self._syncplayClient.userlist.currentUser.file["path"]) if self._syncplayClient.userlist.currentUser.file else None + if currentdirectory and os.path.isdir(currentdirectory): + defaultdirectory = currentdirectory + else: + defaultdirectory = self.getInitialMediaDirectory() + browserfilter = "Playlist (*.m3u8 *.m3u *.txt)" + filepath, filtr = QtWidgets.QFileDialog.getSaveFileName( + self, "Save playlist to file", defaultdirectory, + browserfilter, "", options) # TODO: Move to messages_en + if filepath: + self._syncplayClient.playlist.savePlaylistToFile(filepath) + @needsClient def OpenAddURIsToPlaylistDialog(self): URIsDialog = QtWidgets.QDialog() From 571326d501e39137d45b3db0af9fbd04ed5a3e3b Mon Sep 17 00:00:00 2001 From: et0h Date: Mon, 19 Aug 2019 17:45:21 +0100 Subject: [PATCH 019/112] Don't try to load playlist file that does not exist --- syncplay/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syncplay/client.py b/syncplay/client.py index b253d0d..3f2c7a9 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -1723,6 +1723,10 @@ class SyncplayPlaylist(): return filename def loadPlaylistFromFile(self, path, shuffle=False): + if not os.path.isfile(path): + self._ui.showDebugMessage("Not loading {} as file could not be found".format(path)) + return + with open(path) as f: newPlaylist = f.read().splitlines() if shuffle: From 84ebddd08720b503f6a6d2f1fe8ac814d52ff698 Mon Sep 17 00:00:00 2001 From: et0h Date: Mon, 19 Aug 2019 18:03:38 +0100 Subject: [PATCH 020/112] Include all .ico files in zip/.exe --- buildPy2exe.py | 3 +-- syncplay/__init__.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/buildPy2exe.py b/buildPy2exe.py index dc5b4c6..d972554 100755 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -670,10 +670,9 @@ class build_installer(py2exe): script.compile() print("*** DONE ***") -guiIcons = glob('syncplay/resources/*.png') + ['syncplay/resources/spinner.mng'] +guiIcons = glob('syncplay/resources/*.ico') + glob('syncplay/resources/*.png') + ['syncplay/resources/spinner.mng'] resources = [ - "syncplay/resources/icon.ico", "syncplay/resources/syncplayintf.lua", "syncplay/resources/license.rtf", "syncplay/resources/third-party-notices.rtf" diff --git a/syncplay/__init__.py b/syncplay/__init__.py index 051f38a..da83232 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ version = '1.6.5' revision = ' development' milestone = 'Yoitsu' -release_number = '83' +release_number = '84' projectURL = 'https://syncplay.pl/' From 8bd80d046a11f55e0119538d88f726029af49db1 Mon Sep 17 00:00:00 2001 From: Benjamin O Date: Mon, 18 Nov 2019 12:51:05 -0500 Subject: [PATCH 021/112] Remove some odd locations for icons (#249) --- GNUmakefile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index d68b634..26e75a3 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -37,22 +37,16 @@ endif common: -mkdir -p $(LIB_PATH)/syncplay/syncplay/resources/lua/intf -mkdir -p $(APP_SHORTCUT_PATH) - -mkdir -p $(SHARE_PATH)/app-install/icons - -mkdir -p $(SHARE_PATH)/pixmaps/ cp -r syncplay $(LIB_PATH)/syncplay/ chmod 755 $(LIB_PATH)/syncplay/ cp -r syncplay/resources/hicolor $(SHARE_PATH)/icons/ cp -r syncplay/resources/*.png $(LIB_PATH)/syncplay/syncplay/resources/ cp -r syncplay/resources/*.lua $(LIB_PATH)/syncplay/syncplay/resources/ cp -r syncplay/resources/lua/intf/*.lua $(LIB_PATH)/syncplay/syncplay/resources/lua/intf/ - cp syncplay/resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/app-install/icons/ - cp syncplay/resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/pixmaps/ u-common: -rm -rf $(LIB_PATH)/syncplay -rm $(SHARE_PATH)/icons/hicolor/*/apps/syncplay.png - -rm $(SHARE_PATH)/app-install/icons/syncplay.png - -rm $(SHARE_PATH)/pixmaps/syncplay.png client: -mkdir -p $(BIN_PATH) From bf5c8dd531a5c88479d17f290ec8bdfda425b12a Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Mon, 30 Dec 2019 14:56:27 +0200 Subject: [PATCH 022/112] Fix string equality checks (#267) --- buildPy2exe.py | 4 ++-- syncplay/client.py | 2 +- syncplay/ui/GuiConfiguration.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buildPy2exe.py b/buildPy2exe.py index d972554..84c357e 100755 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -30,7 +30,7 @@ import syncplay from syncplay.messages import getMissingStrings missingStrings = getMissingStrings() -if missingStrings is not None and missingStrings is not "": +if missingStrings is not None and missingStrings != "": import warnings warnings.warn("MISSING/UNUSED STRINGS DETECTED:\n{}".format(missingStrings)) @@ -718,4 +718,4 @@ info = dict( ) sys.argv.extend(['py2exe']) -setup(**info) \ No newline at end of file +setup(**info) diff --git a/syncplay/client.py b/syncplay/client.py index 3f2c7a9..e6d7934 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -135,7 +135,7 @@ class SyncplayClient(object): if constants.DEBUG_MODE and constants.WARN_ABOUT_MISSING_STRINGS: missingStrings = getMissingStrings() - if missingStrings is not None and missingStrings is not "": + if missingStrings is not None and missingStrings != "": self.ui.showDebugMessage("MISSING/UNUSED STRINGS DETECTED:\n{}".format(missingStrings)) def initProtocol(self, protocol): diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index f062707..ee0f0a8 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -320,7 +320,7 @@ class ConfigDialog(QtWidgets.QDialog): try: self.lastCheckedForUpdates = settings.value("lastCheckedQt", None) if self.lastCheckedForUpdates: - if self.config["lastCheckedForUpdates"] is not None and self.config["lastCheckedForUpdates"] is not "": + if self.config["lastCheckedForUpdates"] is not None and self.config["lastCheckedForUpdates"] != "": if self.lastCheckedForUpdates.toPython() > datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f"): self.config["lastCheckedForUpdates"] = self.lastCheckedForUpdates.toString("yyyy-MM-d HH:mm:ss.z") else: From 608203e0eee4f37b064c5e4c4a3735a55bd3bac5 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 13:53:07 +0000 Subject: [PATCH 023/112] Add build status badges --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 383d097..2b29916 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,9 @@ # SOFTWARE. --> -# Syncplay +# Syncplay +[![Travis build Status](https://travis-ci.org/Syncplay/syncplay.svg?branch=master)](https://travis-ci.org/Syncplay/syncplay) +[![Appveyor build status](https://ci.appveyor.com/api/projects/status/github/Syncplay/syncplay)](https://ci.appveyor.com/project/Et0h/syncplay/branch/master) Solution to synchronize video playback across multiple instances of mpv, VLC, MPC-HC, MPC-BE and mplayer2 over the Internet. From 8720e6341522754c139639992fb0f6e6ea0c4bc9 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 14:06:34 +0000 Subject: [PATCH 024/112] Workaround for OSX deploy issues --- travis/macos-deploy.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/travis/macos-deploy.sh b/travis/macos-deploy.sh index 2b192b9..91dfe4a 100755 --- a/travis/macos-deploy.sh +++ b/travis/macos-deploy.sh @@ -11,3 +11,9 @@ mkdir dist/Syncplay.app/Contents/Resources/es_419.lproj pip3 install dmgbuild mv syncplay/resources/macOS_readme.pdf syncplay/resources/.macOS_readme.pdf dmgbuild -s appdmg.py "Syncplay" dist_bintray/Syncplay_${VER}.dmg + +# Workaround for deployment issues with newer openssl. +# See https://travis-ci.community/t/ruby-openssl-python-deployment-fails-on-osx-image/6753/9 +for lib in ssl crypto; do ln -s /usr/local/opt/openssl{@1.0,}/lib/lib${lib}.1.0.0.dylib; done +rvm reinstall $(travis_internal_ruby) --disable-binary +for lib in ssl crypto; do rm /usr/local/opt/openssl/lib/lib${lib}.1.0.0.dylib; done From e9a74fab13a0f8b29b5e6f13aef5aff3a0a93c81 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 14:16:37 +0000 Subject: [PATCH 025/112] Homebrew already has python 3 installed, so don't need to update --- travis/macos-install.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index 78b6425..580ed1d 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -brew update -brew upgrade python which python3 python3 --version which pip3 From 94637bb65d900ade830f24c65336b04f58bc707c Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 14:24:35 +0000 Subject: [PATCH 026/112] Skip the openssl workaround now we're no longer upgrading openssl --- travis/macos-deploy.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/travis/macos-deploy.sh b/travis/macos-deploy.sh index 91dfe4a..97214e9 100755 --- a/travis/macos-deploy.sh +++ b/travis/macos-deploy.sh @@ -10,10 +10,4 @@ mkdir dist/Syncplay.app/Contents/Resources/Spanish.lproj mkdir dist/Syncplay.app/Contents/Resources/es_419.lproj pip3 install dmgbuild mv syncplay/resources/macOS_readme.pdf syncplay/resources/.macOS_readme.pdf -dmgbuild -s appdmg.py "Syncplay" dist_bintray/Syncplay_${VER}.dmg - -# Workaround for deployment issues with newer openssl. -# See https://travis-ci.community/t/ruby-openssl-python-deployment-fails-on-osx-image/6753/9 -for lib in ssl crypto; do ln -s /usr/local/opt/openssl{@1.0,}/lib/lib${lib}.1.0.0.dylib; done -rvm reinstall $(travis_internal_ruby) --disable-binary -for lib in ssl crypto; do rm /usr/local/opt/openssl/lib/lib${lib}.1.0.0.dylib; done +dmgbuild -s appdmg.py "Syncplay" dist_bintray/Syncplay_${VER}.dmg \ No newline at end of file From c4fa7f7a9aaf39c9349bd0d2ec4a3bf439a3bc35 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 17:21:23 +0000 Subject: [PATCH 027/112] Redo travis config in line with modern options --- .travis.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 167bfb3..b245471 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,22 @@ -matrix: +# These two are defaults, which get overriden by the jobs matrix +language: minimal +os: linux + +jobs: include: - language: objective-c + os: osx osx_image: xcode8.3 - language: bash - sudo: required dist: xenial + os: linux env: BUILD_DESTINATION=snapcraft - language: python - sudo: required + os: linux dist: xenial python: 3.6 env: BUILD_DESTINATION=appimage -branches: - only: - - master - script: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then python3 buildPy2app.py py2app ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "snapcraft" ]; then sudo snapcraft cleanbuild ; fi From a93f13f9abb1e169a14b3382bd851af5a615505e Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 17:24:48 +0000 Subject: [PATCH 028/112] Explicitly install Python from homebrew --- travis/macos-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index 580ed1d..061e0a7 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +brew install python which python3 python3 --version which pip3 From 6f6f35704e1139364f8e2c9c9cf2aef46eb9df63 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 17:25:24 +0000 Subject: [PATCH 029/112] Bash is alias for minimal --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b245471..13e3617 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ jobs: - language: objective-c os: osx osx_image: xcode8.3 - - language: bash + - language: minimal dist: xenial os: linux env: BUILD_DESTINATION=snapcraft From 6faf25b9481d9baab5ae7844110b56fdbb26f570 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 17:32:36 +0000 Subject: [PATCH 030/112] Explicitly install Python 3 --- travis/macos-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index 061e0a7..ad17e25 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -brew install python +brew install python3 which python3 python3 --version which pip3 From afaad1f766ae9e5a88d44bb8fe255fe98e99bf21 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 17:34:01 +0000 Subject: [PATCH 031/112] If any part of the osx install fails, stop --- travis/macos-install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index ad17e25..1e873c9 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + brew install python3 which python3 python3 --version From b6e17e08f09dbf01c603f39b602ba3d83d08d806 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 17:41:56 +0000 Subject: [PATCH 032/112] Use stock pyside --- travis/macos-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index 1e873c9..3ffea03 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash -set -e +set -ex brew install python3 which python3 python3 --version which pip3 pip3 --version -brew install albertosottile/syncplay/pyside +brew install pyside python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" pip3 install py2app From a4e84ac65c9d97c707a03e8a0be8fd5aae353cd7 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 17:45:45 +0000 Subject: [PATCH 033/112] Re-add brew update --- travis/macos-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index 3ffea03..51dd1ac 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -2,6 +2,7 @@ set -ex +brew update brew install python3 which python3 python3 --version From 41d0152f2845088db4245489845d6b8bf0125bfa Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 18:01:28 +0000 Subject: [PATCH 034/112] Go back to upgrading python... --- travis/macos-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index 51dd1ac..2da30ef 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -2,8 +2,9 @@ set -ex +export HOMEBREW_NO_INSTALL_CLEANUP=1 brew update -brew install python3 +brew upgrade python which python3 python3 --version which pip3 From baec200c8cda21a9c4333369084a27dc5cc5822f Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 18:01:58 +0000 Subject: [PATCH 035/112] Revert "Skip the openssl workaround now we're no longer upgrading openssl" This reverts commit 94637bb65d900ade830f24c65336b04f58bc707c. --- travis/macos-deploy.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/travis/macos-deploy.sh b/travis/macos-deploy.sh index 97214e9..91dfe4a 100755 --- a/travis/macos-deploy.sh +++ b/travis/macos-deploy.sh @@ -10,4 +10,10 @@ mkdir dist/Syncplay.app/Contents/Resources/Spanish.lproj mkdir dist/Syncplay.app/Contents/Resources/es_419.lproj pip3 install dmgbuild mv syncplay/resources/macOS_readme.pdf syncplay/resources/.macOS_readme.pdf -dmgbuild -s appdmg.py "Syncplay" dist_bintray/Syncplay_${VER}.dmg \ No newline at end of file +dmgbuild -s appdmg.py "Syncplay" dist_bintray/Syncplay_${VER}.dmg + +# Workaround for deployment issues with newer openssl. +# See https://travis-ci.community/t/ruby-openssl-python-deployment-fails-on-osx-image/6753/9 +for lib in ssl crypto; do ln -s /usr/local/opt/openssl{@1.0,}/lib/lib${lib}.1.0.0.dylib; done +rvm reinstall $(travis_internal_ruby) --disable-binary +for lib in ssl crypto; do rm /usr/local/opt/openssl/lib/lib${lib}.1.0.0.dylib; done From 81024f3c066675b0a1c85c0ce588a5707e384531 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 19:40:27 +0000 Subject: [PATCH 036/112] Upgrade to xcode 9.2 (still OSX 10.12) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 13e3617..cfcf6d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ jobs: include: - language: objective-c os: osx - osx_image: xcode8.3 + osx_image: xcode9.2 - language: minimal dist: xenial os: linux From 2dfddda85f4066e5659587f3da89b9421696b8ed Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 14 Mar 2020 23:41:04 +0000 Subject: [PATCH 037/112] Try installing python via Travis homebrew addon --- .travis.yml | 5 +++++ travis/macos-install.sh | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index cfcf6d6..59609ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,11 @@ jobs: - language: objective-c os: osx osx_image: xcode9.2 + addons: + homebrew: + packages: + - python + update: true - language: minimal dist: xenial os: linux diff --git a/travis/macos-install.sh b/travis/macos-install.sh index 2da30ef..f7b55ac 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -2,9 +2,6 @@ set -ex -export HOMEBREW_NO_INSTALL_CLEANUP=1 -brew update -brew upgrade python which python3 python3 --version which pip3 From d297c7af776b43352edcaf9ed6856e0ce8f4b96d Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 00:00:01 +0000 Subject: [PATCH 038/112] Pull install back into scripting --- .travis.yml | 5 ----- travis/macos-install.sh | 9 +++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 59609ea..cfcf6d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,6 @@ jobs: - language: objective-c os: osx osx_image: xcode9.2 - addons: - homebrew: - packages: - - python - update: true - language: minimal dist: xenial os: linux diff --git a/travis/macos-install.sh b/travis/macos-install.sh index f7b55ac..8d358c4 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -2,6 +2,15 @@ set -ex +export HOMEBREW_NO_INSTALL_CLEANUP=1 +brew update + +# An error occurs when upgrading Python, but appears to be benign, hence the "|| true" +# +# Error: undefined method `any?' for nil:NilClass +# /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:227:in `depends_on' +brew upgrade python || true + which python3 python3 --version which pip3 From f85741988d4a1bb91ceb84d73b4a79e97ae23931 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 10:35:54 +0000 Subject: [PATCH 039/112] Reset back to custom tap pyside --- travis/macos-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index 8d358c4..d35618c 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -15,7 +15,7 @@ which python3 python3 --version which pip3 pip3 --version -brew install pyside +brew install albertosottile/syncplay/pyside python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" pip3 install py2app From 1ab7c0e209fe0c98f00c39b93d698ce97dc2bdcd Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 11:53:09 +0000 Subject: [PATCH 040/112] Explicitly install Qt 5.13.1 --- travis/macos-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index d35618c..c4edb10 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -15,6 +15,10 @@ which python3 python3 --version which pip3 pip3 --version + +# Explicitly install Qt 5.13.1 as that has both 10.12 compatibility, and a pre-built bottle +brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb + brew install albertosottile/syncplay/pyside python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" From bc7471fc20cd4d52f59f13823ea76aa7f62f4857 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 12:02:39 +0000 Subject: [PATCH 041/112] Install a explicit particular Python version --- travis/macos-install.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index c4edb10..7d71a92 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -3,20 +3,16 @@ set -ex export HOMEBREW_NO_INSTALL_CLEANUP=1 -brew update -# An error occurs when upgrading Python, but appears to be benign, hence the "|| true" -# -# Error: undefined method `any?' for nil:NilClass -# /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:227:in `depends_on' -brew upgrade python || true +# Python 3.7.4 with 10.12 bottle +brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb which python3 python3 --version which pip3 pip3 --version -# Explicitly install Qt 5.13.1 as that has both 10.12 compatibility, and a pre-built bottle +# Explicitly install Qt 5.13.1 as that has both 10.12 compatibility, and a pre-built bottle brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb brew install albertosottile/syncplay/pyside From 68ca4c1b6050b47821c51e13abee4e1e631ff503 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 12:06:26 +0000 Subject: [PATCH 042/112] Need to explicitly upgrade Python --- travis/macos-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index 7d71a92..e67d879 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -5,7 +5,7 @@ set -ex export HOMEBREW_NO_INSTALL_CLEANUP=1 # Python 3.7.4 with 10.12 bottle -brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb +brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb which python3 python3 --version From 749babd8f9b590144de2fbf62720e0a76d030a0e Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 12:09:32 +0000 Subject: [PATCH 043/112] Remove Qt install --- travis/macos-install.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index e67d879..b6a78f6 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -12,9 +12,6 @@ python3 --version which pip3 pip3 --version -# Explicitly install Qt 5.13.1 as that has both 10.12 compatibility, and a pre-built bottle -brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb - brew install albertosottile/syncplay/pyside python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" From 1358826b2691ed429a1f95e290be43aacde6ebde Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 12:13:14 +0000 Subject: [PATCH 044/112] Upgrade Qt version after the pyside install --- travis/macos-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index b6a78f6..ec01e3d 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -13,6 +13,10 @@ which pip3 pip3 --version brew install albertosottile/syncplay/pyside + +# Explicitly install Qt 5.13.1 as that has both 10.12 compatibility, and a pre-built bottle +brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb + python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" pip3 install py2app From a3f1daee064d9b3a8f46b13fd63de052ed874f63 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 12:17:06 +0000 Subject: [PATCH 045/112] Switch to upstream pyside --- travis/macos-install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index ec01e3d..dd95f7c 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -12,10 +12,11 @@ python3 --version which pip3 pip3 --version -brew install albertosottile/syncplay/pyside - # Explicitly install Qt 5.13.1 as that has both 10.12 compatibility, and a pre-built bottle -brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb +brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb + +# Pyside 5.13.0 for 10.12 bottle +brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/99219f0923014b24f33eae624fbfe83772c35f54/Formula/pyside.rb python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" From 7cc5b6cc6f0824d2cef02cf6d4bd32d0d1adb300 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 12:21:59 +0000 Subject: [PATCH 046/112] Pyside needs Qt 5.13, but installs 5.9 for some reason --- travis/macos-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index dd95f7c..94ff084 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -12,12 +12,12 @@ python3 --version which pip3 pip3 --version -# Explicitly install Qt 5.13.1 as that has both 10.12 compatibility, and a pre-built bottle -brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb - # Pyside 5.13.0 for 10.12 bottle brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/99219f0923014b24f33eae624fbfe83772c35f54/Formula/pyside.rb +# Explicitly upgrade Qt 5.13.1 as the pyside above needs it +brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb + python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" pip3 install py2app From 0505cc247ef5c62130a6f67d6943a9826d025c9c Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 12:34:27 +0000 Subject: [PATCH 047/112] Upgrade openssl --- travis/macos-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index 94ff084..987dbb5 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -5,6 +5,7 @@ set -ex export HOMEBREW_NO_INSTALL_CLEANUP=1 # Python 3.7.4 with 10.12 bottle +brew install openssl@1.1 brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb which python3 From f53f4d3b81e2f2d57efc59214d336237086f05d7 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 12:40:15 +0000 Subject: [PATCH 048/112] Reinstall openssl --- travis/macos-install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index 987dbb5..f1a88d0 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -5,9 +5,11 @@ set -ex export HOMEBREW_NO_INSTALL_CLEANUP=1 # Python 3.7.4 with 10.12 bottle -brew install openssl@1.1 brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb +# Reinstall openssl to fix Python pip install issues +brew reinstall openssl@1.1 + which python3 python3 --version which pip3 @@ -21,6 +23,7 @@ brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" +python3 -c "import ssl; print(ssl)" pip3 install py2app python3 -c "from py2app.recipes import pyside2" pip3 install twisted[tls] appnope requests certifi From ff8e16976cbc3e28b2358c171e7c177b0c34fa46 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 12:49:28 +0000 Subject: [PATCH 049/112] Reinstall openssl, then install Python --- travis/macos-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index f1a88d0..ec8b626 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -4,12 +4,12 @@ set -ex export HOMEBREW_NO_INSTALL_CLEANUP=1 -# Python 3.7.4 with 10.12 bottle -brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb - # Reinstall openssl to fix Python pip install issues brew reinstall openssl@1.1 +# Python 3.7.4 with 10.12 bottle +brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb + which python3 python3 --version which pip3 From 135d34b37dcf614054c7d043031a2574351833fe Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 12:54:59 +0000 Subject: [PATCH 050/112] Install openssl version in line with Python version --- travis/macos-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/macos-install.sh b/travis/macos-install.sh index ec8b626..3d688da 100755 --- a/travis/macos-install.sh +++ b/travis/macos-install.sh @@ -5,7 +5,7 @@ set -ex export HOMEBREW_NO_INSTALL_CLEANUP=1 # Reinstall openssl to fix Python pip install issues -brew reinstall openssl@1.1 +brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/openssl@1.1.rb # Python 3.7.4 with 10.12 bottle brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb From 6588d12cb7aca94e9253f104300ff9612fa492ad Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 15 Mar 2020 12:59:29 +0000 Subject: [PATCH 051/112] Drop Xcode back to 8.3 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cfcf6d6..13e3617 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ jobs: include: - language: objective-c os: osx - osx_image: xcode9.2 + osx_image: xcode8.3 - language: minimal dist: xenial os: linux From 10dfcb5db8e1fa027fbc73ea7f9cdd7cfe1bdda6 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sun, 22 Mar 2020 16:59:02 +0000 Subject: [PATCH 052/112] Remove ruby reinstall workaround for openssl, as not needed --- travis/macos-deploy.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/travis/macos-deploy.sh b/travis/macos-deploy.sh index 91dfe4a..08c74ba 100755 --- a/travis/macos-deploy.sh +++ b/travis/macos-deploy.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -ex + mkdir dist/Syncplay.app/Contents/Resources/English.lproj mkdir dist/Syncplay.app/Contents/Resources/en_AU.lproj mkdir dist/Syncplay.app/Contents/Resources/en_GB.lproj @@ -11,9 +13,3 @@ mkdir dist/Syncplay.app/Contents/Resources/es_419.lproj pip3 install dmgbuild mv syncplay/resources/macOS_readme.pdf syncplay/resources/.macOS_readme.pdf dmgbuild -s appdmg.py "Syncplay" dist_bintray/Syncplay_${VER}.dmg - -# Workaround for deployment issues with newer openssl. -# See https://travis-ci.community/t/ruby-openssl-python-deployment-fails-on-osx-image/6753/9 -for lib in ssl crypto; do ln -s /usr/local/opt/openssl{@1.0,}/lib/lib${lib}.1.0.0.dylib; done -rvm reinstall $(travis_internal_ruby) --disable-binary -for lib in ssl crypto; do rm /usr/local/opt/openssl/lib/lib${lib}.1.0.0.dylib; done From 23ca271ff9dc19ad96c3eb0e34a56ebb5d7728d0 Mon Sep 17 00:00:00 2001 From: Viktor Date: Sun, 5 Apr 2020 14:04:17 +0200 Subject: [PATCH 053/112] German (de) translation update (#287) * Update German translation * Remove stray TODOs --- syncplay/messages_de.py | 282 ++++++++++++++++++++-------------------- 1 file changed, 141 insertions(+), 141 deletions(-) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 9207d67..d952b97 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -16,7 +16,7 @@ de = { "connection-failed-notification": "Verbindung zum Server fehlgeschlagen", "connected-successful-notification": "Erfolgreich mit Server verbunden", "retrying-notification": "%s, versuche erneut in %d Sekunden...", # Seconds - "reachout-successful-notification": "Successfully reached {} ({})", # TODO: Translate + "reachout-successful-notification": "{} ({}) erfolgreich erreicht", "rewind-notification": "Zurückgespult wegen Zeitdifferenz mit {}", # User "fastforward-notification": "Vorgespult wegen Zeitdifferenz mit {}", # User @@ -29,13 +29,13 @@ de = { "current-offset-notification": "Aktueller Offset: {} Sekunden", # Offset - "media-directory-list-updated-notification": "Syncplay media directories have been updated.", # TODO: Translate + "media-directory-list-updated-notification": "Syncplay-Medienverzeichnisse wurden aktualisiert.", - "room-join-notification": "{} hat den Raum '{}' betreten", # User + "room-join-notification": "{} hat den Raum „{}“ betreten", # User "left-notification": "{} ist gegangen", # User "left-paused-notification": "{} ist gegangen, {} pausierte", # User who left, User who paused - "playing-notification": "{} spielt '{}' ({})", # User, file, duration - "playing-notification/room-addendum": " in Raum: '{}'", # Room + "playing-notification": "{} spielt „{}“ ({})", # User, file, duration + "playing-notification/room-addendum": " in Raum: „{}“", # Room "not-all-ready": "Noch nicht bereit: {}", # Usernames "all-users-ready": "Alle sind bereit ({} Nutzer)", # Number of ready users @@ -44,10 +44,10 @@ de = { "set-as-not-ready-notification": "Du bist nicht bereit", "autoplaying-notification": "Starte in {}...", # Number of seconds until playback will start - "identifying-as-controller-notification": "Identifiziere als Raumleiter mit Passwort '{}'...", # TODO: find a better translation to "room operator" + "identifying-as-controller-notification": "Identifiziere als Raumleiter mit Passwort „{}“...", # TODO: find a better translation to "room operator" "failed-to-identify-as-controller-notification": "{} konnte sich nicht als Raumleiter identifizieren.", "authenticated-as-controller-notification": "{} authentifizierte sich als Raumleiter", - "created-controlled-room-notification": "Gesteuerten Raum '{}' mit Passwort '{}' erstellt. Bitte diese Informationen für die Zukunft aufheben!", # RoomName, operatorPassword + "created-controlled-room-notification": "Gesteuerten Raum „{}“ mit Passwort „{}“ erstellt. Bitte diese Informationen für die Zukunft aufheben!", # RoomName, operatorPassword "file-different-notification": "Deine Datei scheint sich von {}s zu unterscheiden", # User "file-differences-notification": "Deine Datei unterscheidet sich auf folgende Art: {}", @@ -62,7 +62,7 @@ de = { "file-played-by-notification": "Datei: {} wird gespielt von:", # File "no-file-played-notification": "{} spielt keine Datei ab", # Username "notplaying-notification": "Personen im Raum, die keine Dateien spielen:", - "userlist-room-notification": "In Raum '{}':", # Room + "userlist-room-notification": "In Raum „{}“:", # Room "userlist-file-notification": "Datei", "controller-userlist-userflag": "Raumleiter", "ready-userlist-userflag": "Bereit", @@ -86,7 +86,7 @@ de = { "commandlist-notification/toggle": "\tt - Bereitschaftsanzeige umschalten", "commandlist-notification/create": "\tc [name] - erstelle zentral gesteuerten Raum mit dem aktuellen Raumnamen", "commandlist-notification/auth": "\ta [password] - authentifiziere als Raumleiter mit Passwort", - "commandlist-notification/chat": "\tch [message] - send a chat message in a room", # TODO: Translate + "commandlist-notification/chat": "\tch [message] - Chatnachricht an einem Raum senden", "syncplay-version-notification": "Syncplay Version: {}", # syncplay.version "more-info-notification": "Weitere Informationen auf: {}", # projectURL @@ -108,18 +108,18 @@ de = { "mpc-be-version-insufficient-error": "MPC-Version nicht ausreichend, bitte nutze `mpc-be` >= `{}`", "mpv-version-error": "Syncplay ist nicht kompatibel mit dieser Version von mpv. Bitte benutze eine andere Version (z.B. Git HEAD).", "player-file-open-error": "Fehler beim Öffnen der Datei durch den Player", - "player-path-error": "Ungültiger Player-Pfad. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end + "player-path-error": "Ungültiger Player-Pfad. Unterstützte Player sind: mpv, mpv.net, VLC, MPC-HC, MPC-BE und mplayer2", "hostname-empty-error": "Hostname darf nicht leer sein", "empty-error": "{} darf nicht leer sein", # Configuration "media-player-error": "Player-Fehler: \"{}\"", # Error line "unable-import-gui-error": "Konnte die GUI-Bibliotheken nicht importieren. PySide muss installiert sein, damit die grafische Oberfläche funktioniert.", - "unable-import-twisted-error": "Could not import Twisted. Please install Twisted v16.4.0 or later.", #To do: translate + "unable-import-twisted-error": "Twisted konnte nicht importiert werden. Bitte installiere Twisted v16.4.0 oder höher", "arguments-missing-error": "Notwendige Argumente fehlen, siehe --help", "unable-to-start-client-error": "Client kann nicht gestartet werden", - "player-path-config-error": "Player-Pfad ist nicht ordnungsgemäß gesetzt. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2.", # To do: Translate end + "player-path-config-error": "Player-Pfad ist nicht ordnungsgemäß gesetzt. Unterstützte Player sind: mpv, mpv.net, VLC, MPC-HC, MPC-BE und mplayer2", "no-file-path-config-error": "Es muss eine Datei ausgewählt werden, bevor der Player gestartet wird.", "no-hostname-config-error": "Hostname darf nicht leer sein", "invalid-port-config-error": "Port muss gültig sein", @@ -132,24 +132,24 @@ de = { "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", - "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 - "feature-readiness": "readiness", # used for not-supported-by-server-error # TODO: Translate - "feature-managedRooms": "managed rooms", # used for not-supported-by-server-error # 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 + "feature-managedRooms": "Zentral gesteuerte Räume", # used for not-supported-by-server-error - "not-supported-by-server-error": "Dieses Feature wird vom Server nicht unterstützt. Es wird ein Server mit Syncplay Version {}+ benötigt, aktuell verwendet wird jedoch Version {}.", # minVersion, serverVersion - "shared-playlists-not-supported-by-server-error": "The shared playlists feature may not be supported by the server. To ensure that it works correctly requires a server running Syncplay {}+, but the server is running Syncplay {}.", # minVersion, serverVersion # TODO: Translate - "shared-playlists-disabled-by-server-error": "The shared playlist feature has been disabled in the server configuration. To use this feature you will need to connect to a different server.", # TODO: Translate + "not-supported-by-server-error": "Diese Funktion wird vom Server nicht unterstützt. Es wird ein Server mit Syncplay Version {}+ benötigt, aktuell verwendet wird jedoch Version {}.", # minVersion, serverVersion + "shared-playlists-not-supported-by-server-error": "Die Geteilte-Playlists-Funktion wird von diesem Server eventuell nicht unterstützt. Um ein korrektes Funktionieren sicherzustellen wird ein Server mit Syncplay Version {}+ benötigt, aktuell verwendet wird jedoch Version {}.", # minVersion, serverVersion + "shared-playlists-disabled-by-server-error": "Die Geteilte-Playlists-Funktion wurde in der Serverkonfiguration deaktiviert. Um diese Funktion zu verwenden, musst du dich mit einem anderen Server verbinden.", "invalid-seek-value": "Ungültige Zeitangabe", "invalid-offset-value": "Ungültiger Offset-Wert", - "switch-file-not-found-error": "Konnte nicht zur Datei '{0}' wechseln. Syncplay looks in the specified media directories.", # File not found, folder it was not found in # TODO: Re-translate "Syncplay sucht im Ordner der aktuellen Datei und angegebenen Medien-Verzeichnissen." to reference to checking in "current media directory" - "folder-search-timeout-error": "The search for media in media directories was aborted as it took too long to search through '{}'. This will occur if you select a folder with too many sub-folders in your list of media folders to search through. For automatic file switching to work again please select File->Set Media Directories in the menu bar and remove this directory or replace it with an appropriate sub-folder. If the folder is actually fine then you can re-enable it by selecting File->Set Media Directories and pressing 'OK'.", # Folder # TODO: Translate - "folder-search-first-file-timeout-error": "The search for media in '{}' was aborted as it took too long to access the directory. This could happen if it is a network drive or if you configure your drive to spin down after a period of inactivity. For automatic file switching to work again please go to File->Set Media Directories and either remove the directory or resolve the issue (e.g. by changing power saving settings).", # Folder # TODO: Translate - "added-file-not-in-media-directory-error": "You loaded a file in '{}' which is not a known media directory. You can add this as a media directory by selecting File->Set Media Directories in the menu bar.", # Folder # TODO: Translate - "no-media-directories-error": "No media directories have been set. For shared playlist and file switching features to work properly please select File->Set Media Directories and specify where Syncplay should look to find media files.", # TODO: Translate - "cannot-find-directory-error": "Could not find media directory '{}'. To update your list of media directories please select File->Set Media Directories from the menu bar and specify where Syncplay should look to find media files.", # TODO: Translate + "switch-file-not-found-error": "Konnte nicht zur Datei „{0}“ wechseln. Syncplay sucht im Verzeichnis der aktuellen Datei und angegebenen Medienverzeichnissen.", # File not found, folder it was not found in + "folder-search-timeout-error": "Die Suche nach Medien in den Medienverzeichnissen wurde abgebrochen, weil es zu lange gedauert hat, „{}“ zu durchsuchen. Das kann passieren, wenn du in deiner Liste der Medienverzeichnisse ein Verzeichnis mit zu vielen Unterverzeichnissen auswhälst. Damit der automatische Dateiwechsel wieder funktioniert, wähle Datei->Medienverzeichnisse auswählen in der Menüleiste und entferne dieses Verzeichnis oder ersetze es mit einem geeigneten Unterverzeichnis. Wenn das Verzeichnis in Ordnung ist, kannst du es reaktivieren, indem du Datei->Medienverzeichnisse auswählen wählst und „OK“ drückst.", # Folder + "folder-search-first-file-timeout-error": "Die Suche nach Medien in den Medienverzeichnissen wurde abgebrochen, weil es zu lange gedauert hat, auf „{}“ zuzugreifen. Das kann passieren, wenn es sich dabei um ein Netzwerkgerät handelt und du eingestellt hast, dass es sich nach Inaktivität ausschaltet. Damit der automatische Dateiwechsel wieder funktioniert, wähle Datei->Medienverzeichnisse auswählen in der Menüleiste und entferne dieses Verzeichnis oder löse das Problem (z.B. indem du die Energiespareinstellungen anpasst).", # Folder + "added-file-not-in-media-directory-error": "Du hast eine Datei in im Verzeichnis „{}“ geladeden, welches kein bekanntes Medienverzeichnis ist. Du kannst es als Medienverzeichnis hinzufügen, indem du Datei->Medienverzeichnisse auswählen in der Menüleiste wählst.", # Folder + "no-media-directories-error": "Es wurden keine Medienverzeichnisse ausgewählt. Damit geteilte Playlists und Dateiwechsel korrekt funktionieren, wähle Datei->Medienverzeichnisse auswählen in der Menüleiste und gib an, wo Syncplay nach Mediendateien suchen soll.", + "cannot-find-directory-error": "Das Medienverzeichnis „{}“ konnte nicht gefunden werden. Um deine Liste an Medienverzeichnissen anzupassen, wähle Datei->Medienverzeichnisse auswählen in der Menüleiste und gib an, wo Syncplay nach Mediendateien suchen soll.", "failed-to-load-server-list-error": "Konnte die Liste der öffentlichen Server nicht laden. Bitte besuche https://www.syncplay.pl/ [Englisch] mit deinem Browser.", @@ -173,10 +173,10 @@ de = { "version-argument": 'gibt die aktuelle Version aus', "version-message": "Du verwendest Syncplay v. {} ({})", - "load-playlist-from-file-argument": "loads playlist from text file (one entry per line)", # TODO: Translate + "load-playlist-from-file-argument": "lädt eine Playlist aus einer Textdatei (ein Eintrag pro Zeile)", # Client labels - "config-window-title": "Syncplay Konfiguration", + "config-window-title": "Syncplay-Konfiguration", "connection-group-title": "Verbindungseinstellungen", "host-label": "Server-Adresse:", @@ -186,7 +186,7 @@ de = { "media-setting-title": "Media-Player Einstellungen", "executable-path-label": "Pfad zum Media-Player:", - "media-path-label": "Pfad zur Datei:", # Todo: Translate to 'Path to video (optional)' + "media-path-label": "Pfad zum Video (optional):", "player-arguments-label": "Playerparameter:", "browse-label": "Durchsuchen", "update-server-list-label": "Liste aktualisieren", @@ -202,10 +202,10 @@ de = { "checkforupdatesautomatically-label": "Automatisch nach Updates suchen", "slowondesync-label": "Verlangsamen wenn nicht synchron (nicht unterstützt mit MPC-HC/BE)", "dontslowdownwithme-label": "Nie verlangsamen oder andere zurückspulen (Experimentell)", - "pausing-title": "Pausing", # TODO: Translate + "pausing-title": "Pausiere", "pauseonleave-label": "Pausieren wenn ein Benutzer austritt", - "readiness-title": "Initial readiness state", # TODO: Translate - "readyatstart-label": "Standardmäßig auf \'Bereit\' stellen", + "readiness-title": "Anfänglicher Bereitschaftsstatus", + "readyatstart-label": "Standardmäßig auf „Bereit“ stellen", "forceguiprompt-label": "Diesen Dialog nicht mehr anzeigen", "showosd-label": "OSD-Nachrichten anzeigen", @@ -230,7 +230,7 @@ de = { "messages-label": "Nachrichten", "messages-osd-title": "OSD-(OnScreenDisplay)-Einstellungen", "messages-other-title": "Weitere Display-Einstellungen", - "chat-label": "Chat", # TODO: Translate + "chat-label": "Chat", "privacy-label": "Privatsphäre", "privacy-title": "Privatsphäreneinstellungen", "unpause-title": "Wenn du Play drückst, auf Bereit setzen und:", @@ -238,36 +238,36 @@ de = { "unpause-ifothersready-option": "Wiedergeben wenn bereits als Bereit gesetzt oder alle anderen bereit sind (Standard)", "unpause-ifminusersready-option": "Wiedergeben wenn bereits als Bereit gesetzt oder die minimale Anzahl anderer Nutzer bereit ist", "unpause-always": "Immer wiedergeben", - "syncplay-trusteddomains-title": "Trusted domains (for streaming services and hosted content)", # TODO: Translate into German + "syncplay-trusteddomains-title": "Vertrauenswürdige Domains (für Streamingdienste und gehostete Inhalte)", - "chat-title": "Chat message input", # TODO: Translate - "chatinputenabled-label": "Enable chat input via mpv (using enter key)", # TODO: Translate - "chatdirectinput-label": "Allow instant chat input (bypass having to press enter key to chat)", # TODO: Translate - "chatinputfont-label": "Chat input font", # TODO: Translate - "chatfont-label": "Set font", # TODO: Translate - "chatcolour-label": "Set colour", # TODO: Translate - "chatinputposition-label": "Position of message input area in mpv", # TODO: Translate - "chat-top-option": "Top", # TODO: Translate - "chat-middle-option": "Middle", # TODO: Translate - "chat-bottom-option": "Bottom", # TODO: Translate - "chatoutputheader-label": "Chat message output", # TODO: Translate - "chatoutputfont-label": "Chat output font", # TODO: Translate - "chatoutputenabled-label": "Enable chat output in media player (mpv only for now)", # TODO: Translate - "chatoutputposition-label": "Output mode", # TODO: Translate - "chat-chatroom-option": "Chatroom style", # TODO: Translate - "chat-scrolling-option": "Scrolling style", # TODO: Translate + "chat-title": "Chatnachrichten-Eingabe", + "chatinputenabled-label": "Chateingabe via mpv erlauben (mit der Entertaste)", + "chatdirectinput-label": "Sofotige Chateingabe erlauben (ohne die Entertaste zu drücken)", + "chatinputfont-label": "Chateingabe-Schriftart", + "chatfont-label": "Schriftart wählen", + "chatcolour-label": "Farbe wählen", + "chatinputposition-label": "Position des Nachrichteneingabe-Felds in mpv", + "chat-top-option": "Oben", + "chat-middle-option": "Mitte", + "chat-bottom-option": "Unten", + "chatoutputheader-label": "Chatnachrichten-Eingabe", + "chatoutputfont-label": "Chateingabe-Schriftart", + "chatoutputenabled-label": "Chatausgabe im Medienplayer aktivieren (bisher nur mpv)", + "chatoutputposition-label": "Ausgabemodus", + "chat-chatroom-option": "Chatroom-Stil", + "chat-scrolling-option": "Scrolling-Stil", - "mpv-key-tab-hint": "[TAB] to toggle access to alphabet row key shortcuts.", # TODO: Translate - "mpv-key-hint": "[ENTER] to send message. [ESC] to escape chat mode.", # TODO: Translate - "alphakey-mode-warning-first-line": "You can temporarily use old mpv bindings with a-z keys.", # TODO: Translate - "alphakey-mode-warning-second-line": "Press [TAB] to return to Syncplay chat mode.", # TODO: Translate + "mpv-key-tab-hint": "[TAB] um Zugriff auf die Buchstabentastenkürzel ein-/auszuschalten.", + "mpv-key-hint": "[ENTER] um eine Nachricht zu senden. [ESC] um den Chatmodus zu verlassen.", + "alphakey-mode-warning-first-line": "Du kannst vorübergehend die alten mpv-Tastaturkürzel mit den a–z-Tasten verwenden.", + "alphakey-mode-warning-second-line": "Drücke [TAB], um in den Syncplay-Chatmodus zurückzukehren.", "help-label": "Hilfe", - "reset-label": "Standardwerte zurücksetzen", + "reset-label": "Auf Standardwerte zurücksetzen", "run-label": "Syncplay starten", "storeandrun-label": "Konfiguration speichern und Syncplay starten", - "contact-label": "Du hast eine Idee, einen Bug gefunden oder möchtest Feedback geben? Sende eine E-Mail an dev@syncplay.pl, chatte auf dem #Syncplay IRC-Kanal auf irc.freenode.net oder öffne eine Fehlermeldung auf GitHub. Außerdem findest du auf https://syncplay.pl/ weitere Informationen, Hilfestellungen und Updates. OTE: Chat messages are not encrypted so do not use Syncplay to send sensitive information.", # TODO: Translate last sentence + "contact-label": "Du hast eine Idee, einen Bug gefunden oder möchtest Feedback geben? Sende eine E-Mail an dev@syncplay.pl, chatte auf dem #Syncplay IRC-Kanal auf irc.freenode.net oder öffne eine Fehlermeldung auf GitHub. Außerdem findest du auf https://syncplay.pl/ weitere Informationen, Hilfestellungen und Updates. Chatnachrichten sind nicht verschlüsselt, also verwende Syncplay nicht, um sensible Daten zu verschicken.", "joinroom-label": "Raum beitreten", "joinroom-menu-label": "Raum beitreten {}", # TODO: Might want to fix this @@ -280,9 +280,9 @@ de = { "autoplay-guipushbuttonlabel": "Automatisch abspielen wenn alle bereit sind", "autoplay-minimum-label": "Minimum an Nutzern:", - "sendmessage-label": "Send", # TODO: Translate + "sendmessage-label": "Senden", - "ready-guipushbuttonlabel": "Ich bin bereit den Film anzuschauen!", + "ready-guipushbuttonlabel": "Ich bin bereit zum Gucken!", "roomuser-heading-label": "Raum / Benutzer", "size-heading-label": "Größe", @@ -296,17 +296,17 @@ de = { "file-menu-label": "&Datei", # & precedes shortcut key "openmedia-menu-label": "&Mediendatei öffnen...", "openstreamurl-menu-label": "&Stream URL öffnen", - "setmediadirectories-menu-label": "Set media &directories", # TODO: Translate - "loadplaylistfromfile-menu-label": "&Load playlist from file", # TODO: Translate - "saveplaylisttofile-menu-label": "&Save playlist to file", # TODO: Translate + "setmediadirectories-menu-label": "Medienverzeichnisse &auswählen", + "loadplaylistfromfile-menu-label": "&Lade Playlist aus Datei", + "saveplaylisttofile-menu-label": "&Speichere Playlist in Datei", "exit-menu-label": "&Beenden", "advanced-menu-label": "&Erweitert", "window-menu-label": "&Fenster", "setoffset-menu-label": "&Offset einstellen", "createcontrolledroom-menu-label": "&Zentral gesteuerten Raum erstellen", "identifyascontroller-menu-label": "Als Raumleiter &identifizieren", - "settrusteddomains-menu-label": "Set &trusted domains", # TODO: Translate - "addtrusteddomain-menu-label": "Add {} as trusted domain", # Domain # TODO: Translate + "settrusteddomains-menu-label": "&Vertrauenswürdige Domains auswählen", + "addtrusteddomain-menu-label": "{} als vertrauenswürdige Domain hinzufügen", # Domain "edit-menu-label": "&Bearbeiten", "cut-menu-label": "Aus&schneiden", @@ -320,39 +320,39 @@ de = { "userguide-menu-label": "&Benutzerhandbuch öffnen", "update-menu-label": "auf &Aktualisierung prüfen", - # startTLS messages - TODO: Translate - "startTLS-initiated": "Attempting secure connection", - "startTLS-secure-connection-ok": "Secure connection established ({})", - "startTLS-server-certificate-invalid": 'Secure connection failed. The server uses an invalid security certificate. This communication could be intercepted by a third party. For further details and troubleshooting see here.', - "startTLS-not-supported-client": "This client does not support TLS", - "startTLS-not-supported-server": "This server does not support TLS", + # startTLS messages + "startTLS-initiated": "Sichere Verbindung wird versucht", + "startTLS-secure-connection-ok": "Sichere Verbindung hergestellt ({})", + "startTLS-server-certificate-invalid": 'Sichere Verbindung fehlgeschlagen. Der Server benutzt ein ungültiges Sicherheitszertifikat. Der Kanal könnte von Dritten abgehört werden. Für weitere Details und Problemlösung siehe hier [Englisch].', + "startTLS-not-supported-client": "Dieser Server unterstützt kein TLS", + "startTLS-not-supported-server": "Dieser Server unterstützt kein TLS", - # TLS certificate dialog - TODO: Translate - "tls-information-title": "Certificate Details", - "tls-dialog-status-label": "Syncplay is using an encrypted connection to {}.", - "tls-dialog-desc-label": "Encryption with a digital certificate keeps information private as it is sent to or from the
server {}.", - "tls-dialog-connection-label": "Information encrypted using Transport Layer Security (TLS), version {} with the cipher
suite: {}.", - "tls-dialog-certificate-label": "Certificate issued by {} valid until {}.", + # TLS certificate dialog + "tls-information-title": "Zertifikatdetails", + "tls-dialog-status-label": "Syncplay nutzt eine verschlüsselte Verbindung zu {}.", + "tls-dialog-desc-label": "Verschlüsselung mit einem digitalen Zertifikat hält Informationen geheim, die vom Server {} gesendet oder empfangen werden.", + "tls-dialog-connection-label": "Daten werden verschlüsselt mit Transport Layer Security (TLS) Version {} und
folgender Chiffre: {}.", + "tls-dialog-certificate-label": "Zertifikat ausgestellt durch {} gültig bis {}.", - # About dialog - TODO: Translate - "about-menu-label": "&About Syncplay", - "about-dialog-title": "About Syncplay", - "about-dialog-release": "Version {} release {}", - "about-dialog-license-text": "Licensed under the Apache License, Version 2.0", - "about-dialog-license-button": "License", - "about-dialog-dependencies": "Dependencies", + # About dialog + "about-menu-label": "&Über Syncplay", + "about-dialog-title": "Über Syncplay", + "about-dialog-release": "Version {} Release {}", + "about-dialog-license-text": "Lizensiert unter der Apache-Lizenz Version 2.0", + "about-dialog-license-button": "Lizenz", + "about-dialog-dependencies": "Abhängigkeiten", "setoffset-msgbox-label": "Offset einstellen", "offsetinfo-msgbox-label": "Offset (siehe https://syncplay.pl/guide/ für eine Anleitung [Englisch]):", - "promptforstreamurl-msgbox-label": "Stream URL öffnen", - "promptforstreamurlinfo-msgbox-label": "Stream URL", + "promptforstreamurl-msgbox-label": "Stream-URL öffnen", + "promptforstreamurlinfo-msgbox-label": "Stream-URL", - "addfolder-label": "Add folder", # TODO: Translate + "addfolder-label": "Verzeichnis hinzufügen", - "adduris-msgbox-label": "Add URLs to playlist (one per line)", # TODO: Translate - "editplaylist-msgbox-label": "Set playlist (one per line)", # TODO: Translate - "trusteddomains-msgbox-label": "Domains it is okay to automatically switch to (one per line)", # TODO: Translate + "adduris-msgbox-label": "URLs zur Playlist hinzufügen (ein Eintrag pro Zeile)", + "editplaylist-msgbox-label": "Playlist auswählen (ein Eintrag pro Zeile)", + "trusteddomains-msgbox-label": "Domains, zu denen automatisch gewechselt werden darf (ein Eintrag pro Zeile)", "createcontrolledroom-msgbox-label": "Zentral gesteuerten Raum erstellen", "controlledroominfo-msgbox-label": "Namen des zentral gesteuerten Raums eingeben\r\n(siehe https://syncplay.pl/guide/ für eine Anleitung [Englisch]):", @@ -372,9 +372,9 @@ de = { "room-tooltip": "Der Raum, der betreten werden soll, kann ein x-beliebiger sein. Allerdings werden nur Clients im selben Raum synchronisiert.", "executable-path-tooltip": "Pfad zum ausgewählten, unterstützten Mediaplayer (MPC-HC, MPC-BE, VLC, mplayer2 or mpv).", - "media-path-tooltip": "Pfad zum wiederzugebenden Video oder Stream. Notwendig für mplayer2.", # TODO: Confirm translation - "player-arguments-tooltip": "Zusätzliche Kommandozeilenparameter / -schalter für diesen Mediaplayer.", - "mediasearcdirectories-arguments-tooltip": "Verzeichnisse, in denen Syncplay nach Mediendateien suchen soll, z.B. wenn du das Click-to-switch-Feature verwendest. Syncplay wird rekursiv Unterordner durchsuchen.", # TODO: Translate Click-to-switch? (or use as name for feature) + "media-path-tooltip": "Pfad zum wiederzugebenden Video oder Stream. Notwendig für mplayer2.", + "player-arguments-tooltip": "Zusätzliche Kommandozeilenparameter/-schalter für diesen Mediaplayer.", + "mediasearcdirectories-arguments-tooltip": "Verzeichnisse, in denen Syncplay nach Mediendateien suchen soll, z.B. wenn du die Click-to-switch-Funktion verwendest. Syncplay wird Unterverzeichnisse rekursiv durchsuchen.", # TODO: Translate Click-to-switch? (or use as name for feature) "more-tooltip": "Weitere Einstellungen anzeigen.", "filename-privacy-tooltip": "Privatheitsmodus beim Senden des Namens der aktuellen Datei zum Server.", @@ -388,11 +388,11 @@ de = { "fastforwardondesync-label": "Vorspulen wenn das Video laggt (empfohlen)", "dontslowdownwithme-tooltip": "Lässt andere nicht langsamer werden oder zurückspringen, wenn deine Wiedergabe hängt.", "pauseonleave-tooltip": "Wiedergabe anhalten, wenn deine Verbindung verloren geht oder jemand den Raum verlässt.", - "readyatstart-tooltip": "Zu Beginn auf 'Bereit' setzen (sonst bist du als 'Nicht Bereit' gesetzt, bis du den Status änderst)", + "readyatstart-tooltip": "Zu Beginn auf „Bereit“ setzen (sonst bist du als „Nicht Bereit“ gesetzt, bis du den Status änderst)", "forceguiprompt-tooltip": "Der Konfigurationsdialog wird nicht angezeigt, wenn eine Datei mit Syncplay geöffnet wird.", "nostore-tooltip": "Syncplay mit den angegebenen Einstellungen starten, diese aber nicht dauerhaft speichern.", "rewindondesync-tooltip": "Zum Wiederherstellen der Synchronität in der Zeit zurückspringen (empfohlen)", - "fastforwardondesync-tooltip": "Nach vorne springen, wenn asynchron zum Raumleiter (oder deine vorgetäuschte Position, falls 'Niemals verlangsamen oder andere zurückspulen' aktiviert ist).", + "fastforwardondesync-tooltip": "Nach vorne springen, wenn asynchron zum Raumleiter (oder deine vorgetäuschte Position, falls „Niemals verlangsamen oder andere zurückspulen“ aktiviert ist).", "showosd-tooltip": "Syncplay-Nachrichten auf dem OSD (= OnScreenDisplay, ein eingeblendetes Textfeld) des Players anzeigen.", "showosdwarnings-tooltip": "Warnungen bei Unterschiedlichen Dateien oder Alleinsein im Raum anzeigen.", "showsameroomosd-tooltip": "OSD-Meldungen über Ereignisse im selben Raum anzeigen.", @@ -405,36 +405,36 @@ de = { "unpause-ifalreadyready-tooltip": "Wenn du nicht bereit bist und Play drückst wirst du als bereit gesetzt - zum Starten der Wiedergabe nochmal drücken.", "unpause-ifothersready-tooltip": "Wenn du Play drückst und nicht bereit bist, wird nur gestartet, wenn alle anderen bereit sind.", "unpause-ifminusersready-tooltip": "Wenn du Play drückst und nicht bereit bist, wird nur gestartet, wenn die minimale Anzahl anderer Benutzer bereit ist.", - "trusteddomains-arguments-tooltip": "Domains that it is okay for Syncplay to automatically switch to when shared playlists is enabled.", # TODO: Translate into German + "trusteddomains-arguments-tooltip": "Domains, zu denen Syncplay automatisch wechself darf, wenn geteilte Playlists aktiviert sind.", - "chatinputenabled-tooltip": "Enable chat input in mpv (press enter to chat, enter to send, escape to cancel)", # TODO: Translate - "chatdirectinput-tooltip": "Skip having to press 'enter' to go into chat input mode in mpv. Press TAB in mpv to temporarily disable this feature.", # TODO: Translate - "font-label-tooltip": "Font used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", # TODO: Translate - "set-input-font-tooltip": "Font family used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", # TODO: Translate - "set-input-colour-tooltip": "Font colour used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", # TODO: Translate - "chatinputposition-tooltip": "Location in mpv where chat input text will appear when you press enter and type.", # TODO: Translate - "chatinputposition-top-tooltip": "Place chat input at top of mpv window.", # TODO: Translate - "chatinputposition-middle-tooltip": "Place chat input in dead centre of mpv window.", # TODO: Translate - "chatinputposition-bottom-tooltip": "Place chat input at bottom of mpv window.", # TODO: Translate - "chatoutputenabled-tooltip": "Show chat messages in OSD (if supported by media player).", # TODO: Translate - "font-output-label-tooltip": "Chat output font.", # TODO: Translate - "set-output-font-tooltip": "Font used for when displaying chat messages.", # TODO: Translate - "chatoutputmode-tooltip": "How chat messages are displayed.", # TODO: Translate - "chatoutputmode-chatroom-tooltip": "Display new lines of chat directly below previous line.", # TODO: Translate - "chatoutputmode-scrolling-tooltip": "Scroll chat text from right to left.", # TODO: Translate + "chatinputenabled-tooltip": "Chateingabe in mpv aktivieren (Drücke Enter zum Chatten, Enter zum Senden, Esc um abzubrechen)", + "chatdirectinput-tooltip": "Überspringe, Enter drücken zu müssen, um in mpv in den Chatmodus zu gelangen. Drücke TAB, um diese Funktion vorübergehend zu deaktivieren.", + "font-label-tooltip": "Schriftart für die Darstellung der Chateingabe in mpv. Nur clientseitig, beeinflusst also nicht, was andere sehen.", + "set-input-font-tooltip": "Schriftfamilie für die Darstellung der Chateingabe in mpv. Nur clientseitig, beeinflusst also nicht, was andere sehen.", + "set-input-colour-tooltip": "Schriftfarbe für die Darstellung der Chateingabe in mpv. Nur clientseitig, beeinflusst also nicht, was andere sehen.", + "chatinputposition-tooltip": "Position in mpv, an der Text der Chateingabe erscheint, wenn du Enter drückst und tippst.", + "chatinputposition-top-tooltip": "Chateingabe oben im mpv-Fenster platzieren.", + "chatinputposition-middle-tooltip": "Chateingabe mittig im mpv-Fenster platzieren.", + "chatinputposition-bottom-tooltip": "Chateingabe unten im mpv-Fenster platzieren.", + "chatoutputenabled-tooltip": "Chatnachrichten im OSD anzeigen (sofern vom Medienplayer unterstützt).", + "font-output-label-tooltip": "Chatausgabe-Schriftart.", + "set-output-font-tooltip": "Schriftart für die Darstellung von Chatnachrichten.", + "chatoutputmode-tooltip": "Wie Chatnachrichten dargestellt werden.", + "chatoutputmode-chatroom-tooltip": "Neue Chatzeilen unmittelbar unterder vorangehenden Zeile anzeigen.", + "chatoutputmode-scrolling-tooltip": "Chat-Text von rechts nach links scrollen lassen", "help-tooltip": "Öffnet Hilfe auf syncplay.pl [Englisch]", "reset-tooltip": "Alle Einstellungen auf Standardwerte zurücksetzen.", "update-server-list-tooltip": "Mit syncplay.pl verbinden um die Liste öffentlicher Server zu aktualisieren.", - "sslconnection-tooltip": "Securely connected to server. Click for certificate details.", # TODO: Translate + "sslconnection-tooltip": "Sicher mit Server verbunden. Klicken, um Zertifikatdetails anzuzeigen.", "joinroom-tooltip": "Den aktuellen Raum verlassen und stattdessen den angegebenen betreten.", "seektime-msgbox-label": "Springe zur angegebenen Zeit (in Sekunden oder min:sek). Verwende +/- zum relativen Springen.", "ready-tooltip": "Zeigt an, ob du bereit zum anschauen bist", "autoplay-tooltip": "Automatisch abspielen, wenn alle Nutzer bereit sind oder die minimale Nutzerzahl erreicht ist.", "switch-to-file-tooltip": "Doppelklicken um zu {} zu wechseln", # Filename - "sendmessage-tooltip": "Send message to room", # TODO: Translate + "sendmessage-tooltip": "Nachricht an Raum senden", # In-userlist notes (GUI) "differentsize-note": "Verschiedene Größe!", @@ -447,7 +447,7 @@ de = { # Server notifications "welcome-server-notification": "Willkommen zum Syncplay-Server, v. {0}", # version - "client-connected-room-server-notification": "{0}({2}) hat den Raum '{1}' betreten", # username, host, room + "client-connected-room-server-notification": "{0}({2}) hat den Raum „{1}“ betreten", # username, host, room "client-left-server-notification": "{0} hat den Server verlassen", # name "no-salt-notification": "WICHTIGER HINWEIS: Damit von dem Server generierte Passwörter für geführte Räume auch nach einem Serverneustart funktionieren, starte den Server mit dem folgenden Parameter: --salt {}", # Salt @@ -455,52 +455,52 @@ de = { "server-argument-description": 'Anwendung, um mehrere MPlayer, MPC-HC/BE und VLC-Instanzen über das Internet zu synchronisieren. Server', "server-argument-epilog": 'Wenn keine Optionen angegeben sind, werden die _config-Werte verwendet', "server-port-argument": 'Server TCP-Port', - "server-password-argument": 'Server Passwort', + "server-password-argument": 'Server-Passwort', "server-isolate-room-argument": 'Sollen die Räume isoliert sein?', "server-salt-argument": "zufällige Zeichenkette, die zur Erstellung von Passwörtern verwendet wird", "server-disable-ready-argument": "Bereitschaftsfeature deaktivieren", "server-motd-argument": "Pfad zur Datei, von der die Nachricht des Tages geladen wird", - "server-chat-argument": "Should chat be disabled?", # TODO: Translate - "server-chat-maxchars-argument": "Maximum number of characters in a chat message (default is {})", # TODO: Translate - "server-maxusernamelength-argument": "Maximum number of characters in a username (default is {})", # TODO: Translate - "server-stats-db-file-argument": "Enable server stats using the SQLite db file provided", # TODO: Translate - "server-startTLS-argument": "Enable TLS connections using the certificate files in the path provided", # TODO: Translate + "server-chat-argument": "Soll Chat deaktiviert werden?", + "server-chat-maxchars-argument": "Maximale Zeichenzahl in einer Chatnachricht (Standard ist {})", + "server-maxusernamelength-argument": "Maximale Zeichenzahl in einem Benutzernamen (Standard ist {})", + "server-stats-db-file-argument": "Aktiviere Server-Statistiken mithilfe der bereitgestellten SQLite-db-Datei", + "server-startTLS-argument": "Erlaube TLS-Verbindungen mit den Zertifikatdateien im Angegebenen Pfad", "server-messed-up-motd-unescaped-placeholders": "Die Nachricht des Tages hat unmaskierte Platzhalter. Alle $-Zeichen sollten verdoppelt werden ($$).", "server-messed-up-motd-too-long": "Die Nachricht des Tages ist zu lang - Maximal {} Zeichen, aktuell {}.", # Server errors "unknown-command-server-error": "Unbekannter Befehl {}", # message "not-json-server-error": "Kein JSON-String {}", # message - "line-decode-server-error": "Not a utf-8 string", # TODO: Translate + "line-decode-server-error": "Keine utf-8-Zeichenkette", "not-known-server-error": "Der Server muss dich kennen, bevor du diesen Befehl nutzen kannst", "client-drop-server-error": "Client verloren: {} -- {}", # host, error "password-required-server-error": "Passwort nötig", "wrong-password-server-error": "Ungültiges Passwort", "hello-server-error": "Zu wenige Hello-Argumente", - # Playlists TODO: Translate all this to German - "playlist-selection-changed-notification": "{} changed the playlist selection", # Username - "playlist-contents-changed-notification": "{} updated the playlist", # Username - "cannot-find-file-for-playlist-switch-error": "Could not find file {} in media directories for playlist switch!", # Filename - "cannot-add-duplicate-error": "Could not add second entry for '{}' to the playlist as no duplicates are allowed.", # Filename - "cannot-add-unsafe-path-error": "Could not automatically load {} because it is not on a trusted domain. You can switch to the URL manually by double clicking it in the playlist, and add trusted domains via File->Advanced->Set Trusted Domains. If you right click on a URL then you can add its domain as a trusted domain via the context menu.", # Filename - "sharedplaylistenabled-label": "Enable shared playlists", - "removefromplaylist-menu-label": "Remove from playlist", - "shuffleremainingplaylist-menu-label": "Shuffle remaining playlist", - "shuffleentireplaylist-menu-label": "Shuffle entire playlist", - "undoplaylist-menu-label": "Undo last change to playlist", - "addfilestoplaylist-menu-label": "Add file(s) to bottom of playlist", - "addurlstoplaylist-menu-label": "Add URL(s) to bottom of playlist", - "editplaylist-menu-label": "Edit playlist", + # Playlists + "playlist-selection-changed-notification": "{} hat die Playlist-Auswahl geändert", # Username + "playlist-contents-changed-notification": "{} hat die Playlist aktualisiert", # Username + "cannot-find-file-for-playlist-switch-error": "Die Datei {} konnte zum Dateiwechsel nicht in den Medienverzeichnissen gefunden werden!", # Filename + "cannot-add-duplicate-error": "Konnte zweiten Eintrag für „{}“ nicht zur Playlist hinzufügen, weil Dubletten nicht erlaubt sind.", # Filename + "cannot-add-unsafe-path-error": "{} konnte nicht automatisch geladen werden, weil es sich nicht um eine vertrauenswürdige Domain handelt. Du kannst manuell zu der URL wechseln, indem du sie in der Playlist doppelklickst oder vertrauenswürdige Domains unter Datei->Erweitert->Vertrauenswürdige Domains auswählen hinzufügst. Wenn du einen Rechtsklick auf eine URL ausführst, kannst du ihre Domain im Kontextmenü als vertrauenswürdig hinzufügen.", # Filename + "sharedplaylistenabled-label": "Geteilte Playlists aktivieren", + "removefromplaylist-menu-label": "Von Playlist entfernen", + "shuffleremainingplaylist-menu-label": "Verbleibende Playlist shuffeln", + "shuffleentireplaylist-menu-label": "Gesamte Playlist shuffeln", + "undoplaylist-menu-label": "Letze Playlist-Änderung rückgängig machen", + "addfilestoplaylist-menu-label": "Datei(en) zum Ende der Playlist hinzufügen", + "addurlstoplaylist-menu-label": "URL(s) zum Ende der Playlist hinzufügen", + "editplaylist-menu-label": "Playlist bearbeiten", - "open-containing-folder": "Open folder containing this file", - "addyourfiletoplaylist-menu-label": "Add your file to playlist", - "addotherusersfiletoplaylist-menu-label": "Add {}'s file to playlist", # [Username] - "addyourstreamstoplaylist-menu-label": "Add your stream to playlist", - "addotherusersstreamstoplaylist-menu-label": "Add {}' stream to playlist", # [Username] - "openusersstream-menu-label": "Open {}'s stream", # [username]'s - "openusersfile-menu-label": "Open {}'s file", # [username]'s + "open-containing-folder": "Übergeordnetes Verzeichnis der Datei öffnen", + "addyourfiletoplaylist-menu-label": "Deine Datei zur Playlist hinzufügen", + "addotherusersfiletoplaylist-menu-label": "{}s Datei zur Playlist hinzufügen", # [Username] + "addyourstreamstoplaylist-menu-label": "Deinen Stream zur Playlist hinzufügen", + "addotherusersstreamstoplaylist-menu-label": "{}s Stream zur Playlist hinzufügen", # [Username] + "openusersstream-menu-label": "{}s Stream öffnen", # [username]'s + "openusersfile-menu-label": "{}s Datei öffnen", # [username]'s - "playlist-instruction-item-message": "Drag file here to add it to the shared playlist.", - "sharedplaylistenabled-tooltip": "Room operators can add files to a synced playlist to make it easy for everyone to watching the same thing. Configure media directories under 'Misc'.", + "playlist-instruction-item-message": "Zieh eine Datei hierher, um sie zur geteilten Playlist hinzuzufügen.", + "sharedplaylistenabled-tooltip": "Raumleiter können Dateien zu einer geteilten Playlist hinzufügen und es so erleichtern, gemeinsam das Gleiche zu gucken. Konfiguriere Medienverzeichnisse unter „Diverse“", } From 2d6d4b43cef63bd1f77952d37c8979ad57bad28a Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Tue, 14 Apr 2020 16:59:15 +0200 Subject: [PATCH 054/112] Work around performance regression in mpv's osd In mpv-player/mpv@07287262513c0d1ea46b7beaf100e73f2008295f, a strcmp on the previously displayed and the new text has been removed, causing excessive GPU usage especially on idle frames when playback was paused. I will submit a patch to upstream, but mpv versions 0.31 & 0.32 are already affected by this. See torque/mpv-progressbar#56 for a similar report to a different script. --- syncplay/resources/syncplayintf.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/syncplay/resources/syncplayintf.lua b/syncplay/resources/syncplayintf.lua index 9115faf..839f4e4 100644 --- a/syncplay/resources/syncplayintf.lua +++ b/syncplay/resources/syncplayintf.lua @@ -133,6 +133,7 @@ function add_chat(chat_message, mood) chat_log[entry] = { xpos=CANVAS_WIDTH, timecreated=mp.get_time(), text=tostring(chat_message), row=row } end +local old_ass_text = '' function chat_update() local ass = assdraw.ass_new() local chat_ass = '' @@ -179,7 +180,14 @@ function chat_update() ass:append(input_ass()) ass:append(chat_ass) end - mp.set_osd_ass(CANVAS_WIDTH,CANVAS_HEIGHT, ass.text) + + -- The commit that introduced the new API removed the internal heuristics on whether a refresh is required, + -- so we check for changed text manually to not cause excessive GPU load + -- https://github.com/mpv-player/mpv/commit/07287262513c0d1ea46b7beaf100e73f2008295f#diff-d88d582039dea993b6229da9f61ba76cL530 + if ass.text ~= old_ass_text then + mp.set_osd_ass(CANVAS_WIDTH,CANVAS_HEIGHT, ass.text) + old_ass_text = ass.text + end end function process_alert_osd() @@ -982,4 +990,4 @@ function set_syncplayintf_options(input) end chat_format = get_output_style() readyMpvAfterSettingsKnown() -end \ No newline at end of file +end From ff5b6696837918d7ade5386d7d3260504983637a Mon Sep 17 00:00:00 2001 From: Alexandria <28266167+alxpettit@users.noreply.github.com> Date: Fri, 17 Apr 2020 06:08:58 -0700 Subject: [PATCH 055/112] fix warning message (#297) /usr/lib/syncplay/syncplay/ui/GuiConfiguration.py:323: SyntaxWarning: "is not" with a literal. Did you mean "!="? --- syncplay/ui/GuiConfiguration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index ee0f0a8..c6f3a30 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -320,7 +320,7 @@ class ConfigDialog(QtWidgets.QDialog): try: self.lastCheckedForUpdates = settings.value("lastCheckedQt", None) if self.lastCheckedForUpdates: - if self.config["lastCheckedForUpdates"] is not None and self.config["lastCheckedForUpdates"] != "": + if self.config["lastCheckedForUpdates"] != None and self.config["lastCheckedForUpdates"] != "": if self.lastCheckedForUpdates.toPython() > datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f"): self.config["lastCheckedForUpdates"] = self.lastCheckedForUpdates.toString("yyyy-MM-d HH:mm:ss.z") else: From 2143b7dcf1b1cddf7b59ee82084eacbc4201bee2 Mon Sep 17 00:00:00 2001 From: et0h Date: Sat, 18 Apr 2020 20:03:48 +0100 Subject: [PATCH 056/112] Fixed trailing newlines breaking messages (#300) --- syncplay/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syncplay/client.py b/syncplay/client.py index e6d7934..5b60888 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -830,6 +830,10 @@ class SyncplayClient(object): @requireServerFeature("chat") def sendChat(self, message): if self._protocol and self._protocol.logged: + try: + message = message.replace("\n", "").replace("\r", "") + except: + pass message = utils.truncateText(message, constants.MAX_CHAT_MESSAGE_LENGTH) self._protocol.sendChatMessage(message) From 1daea64327c432b563201c6543a671053a0d5e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?At=C3=ADlio=20Ant=C3=B4nio=20Dadalto?= Date: Sun, 19 Apr 2020 14:56:57 -0300 Subject: [PATCH 057/112] Add Brazilian Portuguese translation (#291) * Add Brazilian Portuguese translation to Syncplay and its installer * Add new 'pt_BR' language to 'language-argument' * Fix NSIS arguments Insert missing word * Tweak and fix some strings --- buildPy2exe.py | 17 ++ syncplay/messages.py | 2 + syncplay/messages_de.py | 6 +- syncplay/messages_en.py | 2 +- syncplay/messages_es.py | 2 +- syncplay/messages_it.py | 2 +- syncplay/messages_pt_BR.py | 506 +++++++++++++++++++++++++++++++++++++ syncplay/messages_ru.py | 2 +- 8 files changed, 532 insertions(+), 7 deletions(-) create mode 100644 syncplay/messages_pt_BR.py diff --git a/buildPy2exe.py b/buildPy2exe.py index 84c357e..78bb5d6 100755 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -63,6 +63,7 @@ NSIS_SCRIPT_TEMPLATE = r""" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\German.nlf" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Italian.nlf" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Spanish.nlf" + LoadLanguageFile "$${NSISDIR}\Contrib\Language files\PortugueseBR.nlf" Unicode true @@ -101,6 +102,11 @@ NSIS_SCRIPT_TEMPLATE = r""" VIAddVersionKey /LANG=$${LANG_SPANISH} "LegalCopyright" "Syncplay" VIAddVersionKey /LANG=$${LANG_SPANISH} "FileDescription" "Syncplay" + VIAddVersionKey /LANG=$${LANG_PORTUGUESEBR} "ProductName" "Syncplay" + VIAddVersionKey /LANG=$${LANG_PORTUGUESEBR} "FileVersion" "$version.0" + VIAddVersionKey /LANG=$${LANG_PORTUGUESEBR} "LegalCopyright" "Syncplay" + VIAddVersionKey /LANG=$${LANG_PORTUGUESEBR} "FileDescription" "Syncplay" + LangString ^SyncplayLanguage $${LANG_ENGLISH} "en" LangString ^Associate $${LANG_ENGLISH} "Associate Syncplay with multimedia files." LangString ^Shortcut $${LANG_ENGLISH} "Create Shortcuts in following locations:" @@ -154,6 +160,15 @@ NSIS_SCRIPT_TEMPLATE = r""" LangString ^AutomaticUpdates $${LANG_SPANISH} "Buscar actualizaciones automáticamente" LangString ^UninstConfig $${LANG_SPANISH} "Borrar archivo de configuración." + LangString ^SyncplayLanguage $${LANG_PORTUGUESEBR} "pt_BR" + LangString ^Associate $${LANG_PORTUGUESEBR} "Associar Syncplay aos arquivos multimídia." + LangString ^Shortcut $${LANG_PORTUGUESEBR} "Criar atalhos nos seguintes locais:" + LangString ^StartMenu $${LANG_PORTUGUESEBR} "Menu Iniciar" + LangString ^Desktop $${LANG_PORTUGUESEBR} "Área de trabalho" + LangString ^QuickLaunchBar $${LANG_PORTUGUESEBR} "Barra de acesso rápido" + LangString ^AutomaticUpdates $${LANG_PORTUGUESEBR} "Verificar atualizações automaticamente" + LangString ^UninstConfig $${LANG_PORTUGUESEBR} "Deletar arquivo de configuração." + ; Remove text to save space LangString ^ClickInstall $${LANG_GERMAN} " " @@ -259,6 +274,8 @@ NSIS_SCRIPT_TEMPLATE = r""" Push Italiano Push $${LANG_SPANISH} Push Español + Push $${LANG_PORTUGUESEBR} + Push 'Português do Brasil' Push A ; A means auto count languages LangDLL::LangDialog "Language Selection" "Please select the language of Syncplay and the installer" Pop $$LANGUAGE diff --git a/syncplay/messages.py b/syncplay/messages.py index 83d8105..f9fefac 100755 --- a/syncplay/messages.py +++ b/syncplay/messages.py @@ -6,6 +6,7 @@ from . import messages_ru from . import messages_de from . import messages_it from . import messages_es +from . import messages_pt_BR messages = { "en": messages_en.en, @@ -13,6 +14,7 @@ messages = { "de": messages_de.de, "it": messages_it.it, "es": messages_es.es, + "es": messages_pt_BR.pt_BR, "CURRENT": None } diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index d952b97..63330bf 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -139,12 +139,12 @@ de = { "not-supported-by-server-error": "Diese Funktion wird vom Server nicht unterstützt. Es wird ein Server mit Syncplay Version {}+ benötigt, aktuell verwendet wird jedoch Version {}.", # minVersion, serverVersion "shared-playlists-not-supported-by-server-error": "Die Geteilte-Playlists-Funktion wird von diesem Server eventuell nicht unterstützt. Um ein korrektes Funktionieren sicherzustellen wird ein Server mit Syncplay Version {}+ benötigt, aktuell verwendet wird jedoch Version {}.", # minVersion, serverVersion - "shared-playlists-disabled-by-server-error": "Die Geteilte-Playlists-Funktion wurde in der Serverkonfiguration deaktiviert. Um diese Funktion zu verwenden, musst du dich mit einem anderen Server verbinden.", + "shared-playlists-disabled-by-server-error": "Die Geteilte-Playlists-Funktion wurde in der Serverkonfiguration deaktiviert. Um diese Funktion zu verwenden, musst du dich mit einem anderen Server verbinden.", "invalid-seek-value": "Ungültige Zeitangabe", "invalid-offset-value": "Ungültiger Offset-Wert", - "switch-file-not-found-error": "Konnte nicht zur Datei „{0}“ wechseln. Syncplay sucht im Verzeichnis der aktuellen Datei und angegebenen Medienverzeichnissen.", # File not found, folder it was not found in + "switch-file-not-found-error": "Konnte nicht zur Datei „{0}“ wechseln. Syncplay sucht im Verzeichnis der aktuellen Datei und angegebenen Medienverzeichnissen.", # File not found, folder it was not found in "folder-search-timeout-error": "Die Suche nach Medien in den Medienverzeichnissen wurde abgebrochen, weil es zu lange gedauert hat, „{}“ zu durchsuchen. Das kann passieren, wenn du in deiner Liste der Medienverzeichnisse ein Verzeichnis mit zu vielen Unterverzeichnissen auswhälst. Damit der automatische Dateiwechsel wieder funktioniert, wähle Datei->Medienverzeichnisse auswählen in der Menüleiste und entferne dieses Verzeichnis oder ersetze es mit einem geeigneten Unterverzeichnis. Wenn das Verzeichnis in Ordnung ist, kannst du es reaktivieren, indem du Datei->Medienverzeichnisse auswählen wählst und „OK“ drückst.", # Folder "folder-search-first-file-timeout-error": "Die Suche nach Medien in den Medienverzeichnissen wurde abgebrochen, weil es zu lange gedauert hat, auf „{}“ zuzugreifen. Das kann passieren, wenn es sich dabei um ein Netzwerkgerät handelt und du eingestellt hast, dass es sich nach Inaktivität ausschaltet. Damit der automatische Dateiwechsel wieder funktioniert, wähle Datei->Medienverzeichnisse auswählen in der Menüleiste und entferne dieses Verzeichnis oder löse das Problem (z.B. indem du die Energiespareinstellungen anpasst).", # Folder "added-file-not-in-media-directory-error": "Du hast eine Datei in im Verzeichnis „{}“ geladeden, welches kein bekanntes Medienverzeichnis ist. Du kannst es als Medienverzeichnis hinzufügen, indem du Datei->Medienverzeichnisse auswählen in der Menüleiste wählst.", # Folder @@ -168,7 +168,7 @@ de = { "file-argument": 'Abzuspielende Datei', "args-argument": 'Player-Einstellungen; Wenn du Einstellungen, die mit - beginnen, nutzen willst, stelle ein einzelnes \'--\'-Argument davor', "clear-gui-data-argument": 'Setzt die Pfad- und GUI-Fenster-Daten die in den QSettings gespeichert sind zurück', - "language-argument": 'Sprache für Syncplay-Nachrichten (de/en/ru/it/es)', + "language-argument": 'Sprache für Syncplay-Nachrichten (de/en/ru/it/es/pt_BR)', "version-argument": 'gibt die aktuelle Version aus', "version-message": "Du verwendest Syncplay v. {} ({})", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 1b2d96e..0ad1f34 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -168,7 +168,7 @@ en = { "file-argument": 'file to play', "args-argument": 'player options, if you need to pass options starting with - prepend them with single \'--\' argument', "clear-gui-data-argument": 'resets path and window state GUI data stored as QSettings', - "language-argument": 'language for Syncplay messages (de/en/ru/it/es)', + "language-argument": 'language for Syncplay messages (de/en/ru/it/es/pt_BR)', "version-argument": 'prints your version', "version-message": "You're using Syncplay version {} ({})", diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index e216d35..7763bbc 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -168,7 +168,7 @@ es = { "file-argument": 'archivo a reproducir', "args-argument": 'opciones del reproductor, si necesitas pasar opciones que empiezan con -, pásalas utilizando \'--\'', "clear-gui-data-argument": 'restablece ruta y los datos del estado de la ventana GUI almacenados como QSettings', - "language-argument": 'lenguaje para los mensajes de Syncplay (de/en/ru/it/es)', + "language-argument": 'lenguaje para los mensajes de Syncplay (de/en/ru/it/es/pt_BR)', "version-argument": 'imprime tu versión', "version-message": "Estás usando la versión de Syncplay {} ({})", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index ee18fbd..7b41927 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -168,7 +168,7 @@ it = { "file-argument": 'file da riprodurre', "args-argument": 'opzioni del player, se hai bisogno di utilizzare opzioni che iniziano con - anteponi un singolo \'--\'', "clear-gui-data-argument": 'ripristina il percorso e i dati impostati tramite interfaccia grafica e salvati come QSettings', - "language-argument": 'lingua per i messaggi di Syncplay (de/en/ru/it/es)', + "language-argument": 'lingua per i messaggi di Syncplay (de/en/ru/it/es/pt_BR)', "version-argument": 'mostra la tua versione', "version-message": "Stai usando la versione di Syncplay {} ({})", diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py new file mode 100644 index 0000000..15e2dff --- /dev/null +++ b/syncplay/messages_pt_BR.py @@ -0,0 +1,506 @@ +# coding:utf8 + +"""Brazilian Portuguese dictionary""" + +pt_BR = { + "LANGUAGE": "Português do Brasil", + + # Client notifications + "config-cleared-notification": "Configurações removidas. Mudanças serão salvas quando você armazenar uma configuração válida.", + + "relative-config-notification": "Arquivo(s) de configuração relativa carregado(s): {}", + + "connection-attempt-notification": "Tentando se conectar a {}:{}", # Port, IP + "reconnection-attempt-notification": "Conexão com o servidor perdida, tentando reconectar", + "disconnection-notification": "Desconectado do servidor", + "connection-failed-notification": "Conexão com o servidor falhou", + "connected-successful-notification": "Conectado com sucesso ao servidor", + "retrying-notification": "%s, tentando novamente em %d segundos...", # Seconds + "reachout-successful-notification": "Alcançado {} ({}) com sucesso", + + "rewind-notification": "Retrocedendo devido à diferença de tempo com {}", # User + "fastforward-notification": "Avançando devido à diferença de tempo com {}", # User + "slowdown-notification": "Diminuindo a velocidade devido à diferença de tempo com {}", # User + "revert-notification": "Revertendo velocidade ao normal", + + "pause-notification": "{} pausou", # User + "unpause-notification": "{} despausou", # User + "seek-notification": "{} saltou de {} para {}", # User, from time, to time + + "current-offset-notification": "Deslocamento atual: {} segundos", # Offset + + "media-directory-list-updated-notification": "Os diretórios de mídia do Syncplay foram atualizados.", + + "room-join-notification": "{} entrou na sala: '{}'", # User + "left-notification": "{} saiu da sala", # User + "left-paused-notification": "{} saiu da sala, {} pausou", # User who left, User who paused + "playing-notification": "{} está tocando '{}' ({})", # User, file, duration + "playing-notification/room-addendum": " na sala: '{}'", # Room + + "not-all-ready": "Não está pronto: {}", # Usernames + "all-users-ready": "Todo mundo está pronto ({} users)", # Number of ready users + "ready-to-unpause-notification": "Agora você está definido como pronto - despause novamente para despausar", + "set-as-ready-notification": "Agora você está definido como pronto", + "set-as-not-ready-notification": "Agora você está definido como não pronto", + "autoplaying-notification": "Reprodução automática em {}...", # Number of seconds until playback will start + + "identifying-as-controller-notification": "Identificando-se como operador da sala com a senha '{}'...", + "failed-to-identify-as-controller-notification": "{} falhou ao se identificar como operador da sala.", + "authenticated-as-controller-notification": "{} autenticou-se como um operador da sala", + "created-controlled-room-notification": "Criou a sala gerenciada '{}' com a senha '{}'. Por favor, salve essa informação para futura referência!", # RoomName, operatorPassword + + "file-different-notification": "O arquivo que você está tocando parece ser diferente do arquivo de {}", # User + "file-differences-notification": "Seus arquivos se diferem da(s) seguinte(s) forma(s): {}", # Differences + "room-file-differences": "Diferenças de arquivos: {}", # File differences (filename, size, and/or duration) + "file-difference-filename": "nome", + "file-difference-filesize": "tamanho", + "file-difference-duration": "duração", + "alone-in-the-room": "Você está sozinho na sala", + + "different-filesize-notification": " (o tamanho do arquivo deles é diferente do seu!)", + "userlist-playing-notification": "{} está tocando:", # Username + "file-played-by-notification": "Arquivo: {} está sendo tocado por:", # File + "no-file-played-notification": "{} não está tocando um arquivo", # Username + "notplaying-notification": "Pessoas que não estão tocando nenhum arquivo:", + "userlist-room-notification": "Na sala '{}':", # Room + "userlist-file-notification": "Arquivo", + "controller-userlist-userflag": "Operador", + "ready-userlist-userflag": "Pronto", + + "update-check-failed-notification": "Não foi possível verificar automaticamente se o Syncplay {} é a versão mais recente. Deseja visitar https://syncplay.pl/ para checar manualmente por atualizações?", # Syncplay version + "syncplay-uptodate-notification": "O Syncplay está atualizado", + "syncplay-updateavailable-notification": "Uma nova versão do Syncplay está disponível. Deseja visitar a página de lançamentos?", + + "mplayer-file-required-notification": "Syncplay com mplayer requer que você forneça o arquivo ao começar", + "mplayer-file-required-notification/example": "Exemplo de uso: syncplay [opções] [url|caminho_ate_o_arquivo/]nome_do_arquivo", + "mplayer2-required": "O Syncplay é incompatível com o MPlayer 1.x, por favor use mplayer2 ou mpv", + + "unrecognized-command-notification": "Comando não reconhecido", + "commandlist-notification": "Comandos disponíveis:", + "commandlist-notification/room": "\tr [nome] - muda de sala", + "commandlist-notification/list": "\tl - mostra lista de usuários", + "commandlist-notification/undo": "\tu - desfaz último salto", + "commandlist-notification/pause": "\tp - alterna pausa", + "commandlist-notification/seek": "\t[s][+-]time - salta para o valor de tempo dado, se + ou - não forem especificados, será o tempo absoluto em segundos ou minutos:segundos", + "commandlist-notification/help": "\th - esta mensagem de ajuda", + "commandlist-notification/toggle": "\tt - alterna o seu status de prontidão para assistir", + "commandlist-notification/create": "\tc [nome] - cria sala gerenciado usando o nome da sala atual", + "commandlist-notification/auth": "\ta [senha] - autentica-se como operador da sala com a senha", + "commandlist-notification/chat": "\tch [mensagem] - envia uma mensagem no chat da sala", + "syncplay-version-notification": "Versão do Syncplay: {}", # syncplay.version + "more-info-notification": "Mais informações disponíveis em: {}", # projectURL + + "gui-data-cleared-notification": "O Syncplay limpou o caminho e o estado de dados da janela usados pela GUI.", + "language-changed-msgbox-label": "O idioma será alterado quando você salvar as mudanças e abrir o Syncplay novamente.", + "promptforupdate-label": "O Syncplay pode verificar automaticamente por atualizações de tempos em tempos?", + + "media-player-latency-warning": "Aviso: O reprodutor de mídia demorou {} para responder. Se você tiver problemas de sincronização, feche outros programas para liberar recursos do sistema e, se isso não funcionar, tente outro reprodutor de mídia.", # Seconds to respond + "mpv-unresponsive-error": "O mpv não respondeu por {} segundos, portanto parece que não está funcionando. Por favor, reinicie o Syncplay.", # Seconds to respond + + # Client prompts + "enter-to-exit-prompt": "Aperte Enter para sair\n", + + # Client errors + "missing-arguments-error": "Alguns argumentos necessários estão faltando, por favor reveja --help", + "server-timeout-error": "A conexão com o servidor ultrapassou o tempo limite", + "mpc-slave-error": "Não foi possível abrir o MPC no slave mode!", + "mpc-version-insufficient-error": "A versão do MPC é muito antiga, por favor use `mpc-hc` >= `{}`", + "mpc-be-version-insufficient-error": "A versão do MPC-BE é muito antiga, por favor use `mpc-be` >= `{}`", + "mpv-version-error": "O Syncplay não é compatível com esta versão do mpv. Por favor, use uma versão diferente do mpv (por exemplo, Git HEAD).", + "player-file-open-error": "O reprodutor falhou ao abrir o arquivo", + "player-path-error": "O caminho até o arquivo executável do reprodutor não está configurado corretamente. Os reprodutores suportados são: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2", + "hostname-empty-error": "O endereço do servidor não pode ser vazio", + "empty-error": "{} não pode ser vazio", # Configuration + "media-player-error": "Erro do reprodutor de mídia: \"{}\"", # Error line + "unable-import-gui-error": "Não foi possível importar bibliotecas da GUI. Se você não possuir o PySide instalado, instale-o para que a GUI funcione.", + "unable-import-twisted-error": "Não foi possível importar o Twisted. Por favor, instale o Twisted v16.4.0 ou superior.", + + "arguments-missing-error": "Alguns argumentos necessários estão faltando, por favor reveja --help", + + "unable-to-start-client-error": "Não foi possível iniciar o client", + + "player-path-config-error": "O caminho até o arquivo executável do reprodutor não está configurado corretamente. Os reprodutores suportados são: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2.", + "no-file-path-config-error": "O arquivo deve ser selecionado antes de iniciar seu reprodutor", + "no-hostname-config-error": "O endereço do servidor não pode ser vazio", + "invalid-port-config-error": "A porta deve ser válida", + "empty-value-config-error": "{} não pode ser vazio", # Config option + + "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-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.", + + "feature-sharedPlaylists": "playlists compartilhadas", # used for not-supported-by-server-error + "feature-chat": "chat", # used for not-supported-by-server-error + "feature-readiness": "prontidão", # used for not-supported-by-server-error + "feature-managedRooms": "salas gerenciadas", # used for not-supported-by-server-error + + "not-supported-by-server-error": "O recurso {} não é suportado por este servidor.", # feature + "shared-playlists-not-supported-by-server-error": "O recurso de playlists compartilhadas pode não ser suportado por este servidor. Para garantir que funcione corretamente, é necessário um servidor rodando Syncplay {} ou superior, mas este está rodando Syncplay {}.", # minVersion, serverVersion + "shared-playlists-disabled-by-server-error": "O recurso de playlists compartilhadas foi desativado nas configurações do servidor. Para usar este recurso, você precisa se conectar a um servidor diferente.", + + "invalid-seek-value": "Valor de salto inválido", + "invalid-offset-value": "Valor de deslocamento inválido", + + "switch-file-not-found-error": "Não foi possível mudar para o arquivo '{0}'. O Syncplay procura nos diretórios de mídia especificados.", # File not found + "folder-search-timeout-error": "A busca por mídias no diretório de mídias foi cancelada pois demorou muito tempo para procurar em '{}'. Isso ocorre quando você seleciona uma pasta com muitas subpastas em sua lista de pastas de mídias a serem pesquisadas. Para que a troca automática de arquivos funcione novamente, selecione 'Arquivo -> Definir diretórios de mídias' na barra de menus e remova esse diretório ou substitua-o por uma subpasta apropriada. Se a pasta não tiver problemas, é possível reativá-la selecionando 'Arquivo -> Definir diretórios de mídias' e pressionando 'OK'.", # Folder + "folder-search-first-file-timeout-error": "A busca por mídias em '{}' foi interrompida, pois demorou muito para acessar o diretório. Isso pode acontecer se for uma unidade de rede ou se você configurar sua unidade para hibernar depois de um período de inatividade. Para que a troca automática de arquivos funcione novamente, vá para 'Arquivo -> Definir diretórios de mídias' e remova o diretório ou resolva o problema (por exemplo, alterando as configurações de economia de energia da unidade).", # Folder + "added-file-not-in-media-directory-error": "Você carregou um arquivo em '{}', que não é um diretório de mídias conhecido. Você pode adicioná-lo isso como um diretório de mídia selecionando 'Arquivo -> Definir diretórios de mídias' na barra de menus.", # Folder + "no-media-directories-error": "Nenhum diretório de mídias foi definido. Para que os recursos de playlists compartilhadas e troca automática de arquivos funcionem corretamente, selecione 'Arquivo -> Definir diretórios de mídias' e especifique onde o Syncplay deve procurar para encontrar arquivos de mídia.", + "cannot-find-directory-error": "Não foi possível encontrar o diretório de mídia '{}'. Para atualizar sua lista de diretórios de mídias, selecione 'Arquivo -> Definir diretórios de mídias' na barra de menus e especifique onde o Syncplay deve procurar para encontrar arquivos de mídia.", + + "failed-to-load-server-list-error": "Não foi possível carregar a lista de servidores públicos. Por favor, visite https://www.syncplay.pl/ em seu navegador.", + + # Client arguments + "argument-description": 'Solução para sincronizar reprodução de múltiplas instâncias de reprodutores de mídia pela rede.', + "argument-epilog": 'Se nenhuma opção for fornecida, os valores de _config serão usados', + "nogui-argument": 'não mostrar GUI', + "host-argument": 'endereço do servidor', + "name-argument": 'nome de usuário desejado', + "debug-argument": 'modo depuração', + "force-gui-prompt-argument": 'fazer o prompt de configuração aparecer', + "no-store-argument": 'não guardar valores em .syncplay', + "room-argument": 'sala padrão', + "password-argument": 'senha do servidor', + "player-path-argument": 'caminho até o executável do reprodutor de mídia', + "file-argument": 'arquivo a ser tocado', + "args-argument": 'opções do reprodutor; se você precisar passar opções começando com -, as preceda com um único argumento \'--\'', + "clear-gui-data-argument": 'redefine o caminho e o estado de dados da janela da GUI para as de QSettings', + "language-argument": 'idioma para mensagens do Syncplay (de/en/ru/it/es/pt_BR)', + + "version-argument": 'exibe sua versão', + "version-message": "Você está usando o Syncplay versão {} ({})", + + "load-playlist-from-file-argument": "carrega playlist de um arquivo de texto (uma entrada por linha)", + + # Client labels + "config-window-title": "Configuração do Syncplay", + + "connection-group-title": "Configurações de conexão", + "host-label": "Endereço do servidor: ", + "name-label": "Nome de usuário (opcional): ", + "password-label": "Senha do servidor (se existir): ", + "room-label": "Sala padrão: ", + + "media-setting-title": "Configurações do reprodutor de mídia", + "executable-path-label": "Executável do reprodutor:", + "media-path-label": "Arquivo de vídeo ou URL (opcional):", + "player-arguments-label": "Argumentos para o reprodutor (opcional):", + "browse-label": "Navegar", + "update-server-list-label": "Atualizar lista", + + "more-title": "Mostrar mais configurações", + "never-rewind-value": "Nunca", + "seconds-suffix": " s", + "privacy-sendraw-option": "Enviar bruto", + "privacy-sendhashed-option": "Enviar hasheado", + "privacy-dontsend-option": "Não enviar", + "filename-privacy-label": "Informação do nome do arquivo:", + "filesize-privacy-label": "Informação do tamanho do arquivo:", + "checkforupdatesautomatically-label": "Verificar atualizações do Syncplay automaticamente", + "slowondesync-label": "Diminuir velocidade em dessincronizações menores (não suportado pelo MPC-HC/BE)", + "rewindondesync-label": "Retroceder em dessincronização maiores (recomendado)", + "fastforwardondesync-label": "Avançar se estiver ficando para trás (recomendado)", + "dontslowdownwithme-label": "Nunca desacelerar ou retroceder outros (experimental)", + "pausing-title": "Pausando", + "pauseonleave-label": "Pausar quando um usuário sair (por exemplo, se for desconectado)", + "readiness-title": "Estado de prontidão inicial", + "readyatstart-label": "Marque-me como 'pronto para assistir' por padrão", + "forceguiprompt-label": "Não mostrar sempre a janela de configuração do Syncplay", # (Inverted) + "showosd-label": "Ativar mensagens na tela (OSD)", + + "showosdwarnings-label": "Incluir avisos (por exemplo, quando arquivos são diferentes, usuários não estão prontos, etc)", + "showsameroomosd-label": "Incluir eventos da sua sala", + "shownoncontrollerosd-label": "Incluir eventos de não operadores em salas gerenciadas", + "showdifferentroomosd-label": "Incluir eventos de outras salas", + "showslowdownosd-label": "Incluir notificações de desaceleramento ou retrocedimento", + "language-label": "Idioma:", + "automatic-language": "Padrão ({})", # Default language + "showdurationnotification-label": "Avisar sobre discrepância nas durações dos arquivos de mídia", + "basics-label": "Básicos", + "readiness-label": "Play/Pause", + "misc-label": "Miscelânea", + "core-behaviour-title": "Comportamento da sala padrão", + "syncplay-internals-title": "Syncplay internals", + "syncplay-mediasearchdirectories-title": "Diretórios a buscar por mídias", + "syncplay-mediasearchdirectories-label": "Diretórios a buscar por mídias (um caminho por linha)", + "sync-label": "Sincronizar", + "sync-otherslagging-title": "Se outros estiverem ficando pra trás...", + "sync-youlaggging-title": "Se você estiver ficando pra trás...", + "messages-label": "Mensagens", + "messages-osd-title": "Configurações das mensagens na tela (OSD)", + "messages-other-title": "Outras configurações de tela", + "chat-label": "Chat", + "privacy-label": "Privacidade", # Currently unused, but will be brought back if more space is needed in Misc tab + "privacy-title": "Configurações de privacidade", + "unpause-title": "Se você apertar play, definir-se como pronto e:", + "unpause-ifalreadyready-option": "Despausar se você já estiver definido como pronto", + "unpause-ifothersready-option": "Despausar se você já estiver pronto ou outros na sala estiverem prontos (padrão)", + "unpause-ifminusersready-option": "Despausar se você já estiver pronto ou outros na sala estiverem prontos e o número mínimo de usuários está pronto", + "unpause-always": "Sempre despausar", + "syncplay-trusteddomains-title": "Domínios confiáveis (para serviços de streaming e conteúdo hospedado)", + + "chat-title": "Entrada de mensagem do chat", + "chatinputenabled-label": "Habilitar entrada de chat via mpv", + "chatdirectinput-label": "Permitir entrada instantânea de chat (evita ter de apertar Enter para abrir o chat)", + "chatinputfont-label": "Fonte da entrada de chat", + "chatfont-label": "Definir fonte", + "chatcolour-label": "Definir cor", + "chatinputposition-label": "Posição da área de entrada de mensagens no mpv", + "chat-top-option": "Topo", + "chat-middle-option": "Meio", + "chat-bottom-option": "Fundo", + "chatoutputheader-label": "Saída de mensagem do chat", + "chatoutputfont-label": "Fonte da saída de chat", + "chatoutputenabled-label": "Habilitar saída de chat no reprodutor de mídia (apenas mpv por enquanto)", + "chatoutputposition-label": "Modo de saída", + "chat-chatroom-option": "Estilo sala de bate-papo", + "chat-scrolling-option": "Estilo de rolagem", + + "mpv-key-tab-hint": "[TAB] para alternar acesso instantâneo ao chat.", + "mpv-key-hint": "[ENTER] para enviar mensagem. [ESC] para sair do modo de chat.", + "alphakey-mode-warning-first-line": "Você pode usar os antigos atalhos do mpv com as teclas a-z.", + "alphakey-mode-warning-second-line": "Aperte [TAB] para retornar ao modo de chat instantâneo do Syncplay.", + + "help-label": "Ajuda", + "reset-label": "Restaurar padrões", + "run-label": "Começar Syncplay", + "storeandrun-label": "Salvar mudanças e começar Syncplay", + + "contact-label": "Sinta-se livre para mandar um e-mail para dev@syncplay.pl, conversar via chat pelo canal do IRC #Syncplay no irc.freenode.net, abrir uma issue pelo GitHub, curtir nossa página no Facebook, nos seguir no Twitter ou visitar https://syncplay.pl/. Não use o Syncplay para mandar informações sensíveis/confidenciais.", + + "joinroom-label": "Juntar-se a uma sala", + "joinroom-menu-label": "Juntar-se à sala {}", + "seektime-menu-label": "Saltar para o tempo", + "undoseek-menu-label": "Desfazer salto", + "play-menu-label": "Play", + "pause-menu-label": "Pause", + "playbackbuttons-menu-label": "Mostrar botões de reprodução", + "autoplay-menu-label": "Mostrar botão de reprodução automática", + "autoplay-guipushbuttonlabel": "Tocar quando todos estiverem prontos", + "autoplay-minimum-label": "Mín. de usuários:", + + "sendmessage-label": "Enviar", + + "ready-guipushbuttonlabel": "Estou pronto para assistir!", + + "roomuser-heading-label": "Sala / Usuário", + "size-heading-label": "Tamanho", + "duration-heading-label": "Duração", + "filename-heading-label": "Nome do arquivo", + "notifications-heading-label": "Notificações", + "userlist-heading-label": "Lista de quem está tocando o quê", + + "browseformedia-label": "Navegar por arquivos de mídia", + + "file-menu-label": "&Arquivo", # & precedes shortcut key + "openmedia-menu-label": "A&brir arquivo de mídia", + "openstreamurl-menu-label": "Abrir &URL de stream de mídia", + "setmediadirectories-menu-label": "Definir &diretórios de mídias", + "loadplaylistfromfile-menu-label": "&Carregar playlist de arquivo", + "saveplaylisttofile-menu-label": "&Salvar playlist em arquivo", + "exit-menu-label": "&Sair", + "advanced-menu-label": "A&vançado", + "window-menu-label": "&Janela", + "setoffset-menu-label": "Definir &deslocamento", + "createcontrolledroom-menu-label": "&Criar sala gerenciada", + "identifyascontroller-menu-label": "&Identificar-se como operador da sala", + "settrusteddomains-menu-label": "D&efinir domínios confiáveis", + "addtrusteddomain-menu-label": "Adicionar {} como domínio confiável", # Domain + + "edit-menu-label": "&Editar", + "cut-menu-label": "Cor&tar", + "copy-menu-label": "&Copiar", + "paste-menu-label": "C&olar", + "selectall-menu-label": "&Selecionar todos", + + "playback-menu-label": "&Reprodução", + + "help-menu-label": "&Ajuda", + "userguide-menu-label": "Abrir &guia de usuário", + "update-menu-label": "&Verificar atualizações", + + "startTLS-initiated": "Tentando estabelecer conexão segura", + "startTLS-secure-connection-ok": "Conexão segura estabelecida ({})", + "startTLS-server-certificate-invalid": 'Não foi possível estabelecer uma conexão segura. O servidor usa um certificado de segurança inválido. Essa comunicação pode ser interceptada por terceiros. Para mais detalhes de solução de problemas, consulte aqui.', + "startTLS-not-supported-client": "Este client não possui suporte para TLS", + "startTLS-not-supported-server": "Este servidor não possui suporte para TLS", + + # TLS certificate dialog + "tls-information-title": "Detalhes do certificado", + "tls-dialog-status-label": "Syncplay está usando uma conexão criptografada para {}.", + "tls-dialog-desc-label": "A criptografia com um certificado digital mantém as informações em sigilo quando são enviadas para ou do
servidor {}.", + "tls-dialog-connection-label": "Informações criptografadas usando o Transport Layer Security (TLS), versão {} com o conjunto de cifras (cipher suite)
: {}.", + "tls-dialog-certificate-label": "Certificado emitido em {} e válido até {}.", + + # About dialog + "about-menu-label": "&Sobre o Syncplay", + "about-dialog-title": "Sobre o Syncplay", + "about-dialog-release": "Versão {}, lançamento {}", + "about-dialog-license-text": "Licenciado sob a Licença Apache, Versão 2.0", + "about-dialog-license-button": "Licença", + "about-dialog-dependencies": "Dependências", + + "setoffset-msgbox-label": "Definir deslocamento", + "offsetinfo-msgbox-label": "Deslocamento (veja https://syncplay.pl/guide/ para instruções de uso):", + + "promptforstreamurl-msgbox-label": "Abrir transmissão de mídia via URL", + "promptforstreamurlinfo-msgbox-label": "Transmitir URL", + + "addfolder-label": "Adicionar pasta", + + "adduris-msgbox-label": "Adicionar URLs à playlist (uma por linha)", + "editplaylist-msgbox-label": "Definir playlist (uma por linha)", + "trusteddomains-msgbox-label": "Domínios para os quais é permitido trocar automaticamente (um por linha)", + + "createcontrolledroom-msgbox-label": "Criar sala gerenciada", + "controlledroominfo-msgbox-label": "Informe o nome da sala gerenciada\r\n(veja https://syncplay.pl/guide/ para instruções de uso):", + + "identifyascontroller-msgbox-label": "Identificar-se como operador da sala", + "identifyinfo-msgbox-label": "Informe a senha de operador para esta sala\r\n(veja https://syncplay.pl/guide/ para instruções de uso):", + + "public-server-msgbox-label": "Selecione o servidor público para esta sessão de visualização", + + "megabyte-suffix": " MB", + + # Tooltips + + "host-tooltip": "Hostname ou IP para se conectar, opcionalmente incluindo uma porta (por exemplo, syncplay.pl:8999). Só sincroniza-se com pessoas no mesmo servidor/porta.", + "name-tooltip": "Nome pelo qual você será conhecido. Não há cadastro, então você pode facilmente mudar mais tarde. Se não for especificado, será gerado aleatoriamente.", + "password-tooltip": "Senhas são necessárias apenas para servidores privados.", + "room-tooltip": "O nome da sala para se conectar pode ser praticamente qualquer coisa, mas você só irá se sincronizar com pessoas na mesma sala.", + + "executable-path-tooltip": "Localização do seu reprodutor de mídia preferido (mpv, VLC, MPC-HC/BE ou mplayer2).", + "media-path-tooltip": "Localização do vídeo ou transmissão a ser aberto. Necessário com o mplayer2.", + "player-arguments-tooltip": "Argumentos de comando de linha adicionais para serem repassados ao reprodutor de mídia.", + "mediasearcdirectories-arguments-tooltip": "Diretório onde o Syncplay vai procurar por arquivos de mídia, por exemplo quando você estiver usando o recurso de clicar para mudar. O Syncplay irá procurar recursivamente pelas subpastas.", + + "more-tooltip": "Exibe configurações menos frequentemente utilizadas.", + "filename-privacy-tooltip": "Modo de privacidade para mandar nome de arquivo do arquivo atual para o servidor.", + "filesize-privacy-tooltip": "Modo de privacidade para mandar tamanho do arquivo atual para o servidor.", + "privacy-sendraw-tooltip": "Enviar esta informação sem ofuscação. Esta é a opção padrão com mais funcionalidades.", + "privacy-sendhashed-tooltip": "Mandar versão hasheada da informação, tornando-a menos visível aos outros clients.", + "privacy-dontsend-tooltip": "Não enviar esta informação ao servidor. Esta opção oferece a maior privacidade.", + "checkforupdatesautomatically-tooltip": "Checar o site do Syncplay regularmente para ver se alguma nova versão do Syncplay está disponível.", + "slowondesync-tooltip": "Reduzir a velocidade de reprodução temporariamente quando necessário para trazer você de volta à sincronia com os outros espectadores. Não suportado pelo MPC-HC/BE.", + "dontslowdownwithme-tooltip": "Significa que outros não serão desacelerados ou retrocedidos se sua reprodução estiver ficando para trás. Útil para operadores de salas.", + "pauseonleave-tooltip": "Pausar reprodução se você for disconectado ou se alguém sair da sua sala.", + "readyatstart-tooltip": "Definir-se como 'pronto' ao começar (do contrário você será definido como 'não pronto' até mudar seu estado de prontidão)", + "forceguiprompt-tooltip": "Diálogo de configuração não é exibido ao abrir um arquivo com o Syncplay.", # (Inverted) + "nostore-tooltip": "Começar Syncplay com a dada configuração, mas não guardar as mudanças permanentemente.", # (Inverted) + "rewindondesync-tooltip": "Retroceder automaticamente quando necessário para sincronizar. Desabilitar isto pode resultar em grandes dessincronizações!", + "fastforwardondesync-tooltip": "Avançar automaticamente quando estiver fora de sincronia com o operador da sala (ou sua posição pretendida caso 'Nunca desacelerar ou retroceder outros' estiver habilitada).", + "showosd-tooltip": "Envia mensagens do Syncplay à tela do reprodutor de mídia (OSD).", + "showosdwarnings-tooltip": "Mostra avisos se: estiver tocando arquivos diferentes, sozinho na sala, usuários não prontos, etc.", + "showsameroomosd-tooltip": "Mostra notificações na tela (OSD) sobre eventos relacionados à sala em que o usuário está.", + "shownoncontrollerosd-tooltip": "Mostra notificações na tela (OSD) sobre eventos relacionados a não operadores que estão em salas gerenciadas.", + "showdifferentroomosd-tooltip": "Mostra notificações na tela (OSD) sobre eventos relacionados à sala em que o usuário não está.", + "showslowdownosd-tooltip": "Mostra notificações na tela (OSD) sobre desaceleramento/retrocedimento por conta de diferença nos tempos.", + "showdurationnotification-tooltip": "Útil quando um segmento em um arquivo de múltiplas partes está faltando, mas pode resultar em falsos positivos.", + "language-tooltip": "Idioma a ser utilizado pelo Syncplay.", + "unpause-always-tooltip": "Se você pressionar para despausar, sempre te definirá como pronto e despausará em vez de simplesmente te definir com pronto.", + "unpause-ifalreadyready-tooltip": "Se você pressionar para despausar quando não estiver pronto, irá te definir como pronto - despause novamente para despausar.", + "unpause-ifothersready-tooltip": "Se você apertar para despausar quando não estiver pronto, só irá despausar quando outros estiverem prontos.", + "unpause-ifminusersready-tooltip": "Se você apertar para despausar quando não estiver pronto, só irá despausar quando outros estiverem prontos e o número mínimo de usuários for atingido.", + "trusteddomains-arguments-tooltip": "Domínios para os quais é permitido trocar automaticamente quando as playlists compartilhadas estiverem habilitadas.", + + "chatinputenabled-tooltip": "Ativar entrada de chat via mpv (pressione Enter para escrever, Enter para enviar, ESC para cancelar)", + "chatdirectinput-tooltip": "Evita ter de apertar 'Enter' para entrar no modo de entrada de chat no mpv. Pressione TAB no mpv para temporariamente desabilitar esta função.", + "font-label-tooltip": "Fonte usada ao escrever mensagens no chat no mpv. Apenas no lado do client, portanto não afeta a cor que os outros veem.", + "set-input-font-tooltip": "Família de fonte usada ao escrever mensagens no chat no mpv. Apenas no lado do client, portanto não afeta a cor que os outros veem.", + "set-input-colour-tooltip": "Cor de fonte usada ao escrever mensagens no chat no mpv. Apenas no lado do client, portanto não afeta a cor que os outros veem.", + "chatinputposition-tooltip": "Lugar no mpv onde a entrada de chat será exibida quando você apertar Enter e digitar.", + "chatinputposition-top-tooltip": "Colocar entrada de chat no topo da janela do mpv.", + "chatinputposition-middle-tooltip": "Colocar entrada de chat no meio da janela do mpv.", + "chatinputposition-bottom-tooltip": "Colocar entrada de chat no fundo da janela do mpv.", + "chatoutputenabled-tooltip": "Mostrar mensagens de chat na tela do reprodutor (OSD) (se suportado pelo reprodutor).", + "font-output-label-tooltip": "Fonte da saída de chat.", + "set-output-font-tooltip": "Fonte usada para exibir mensagens do chat.", + "chatoutputmode-tooltip": "Como as mensagens do chat são exibidas.", + "chatoutputmode-chatroom-tooltip": "Exibe novas linhas de chat diretamente abaixo da linha anterior.", + "chatoutputmode-scrolling-tooltip": "Exibe novas linhas de chat rolando-as da direita pra esquerda.", + + "help-tooltip": "Abre o guia de usuário do Syncplay.pl.", + "reset-tooltip": "Redefine todas as configurações para seus respectivos padrões.", + "update-server-list-tooltip": "Conecta ao syncplay.pl para atualizar a lista de servidores públicos.", + + "sslconnection-tooltip": "Conectado com segurança ao servidor. Clique para exibir detalhes do certificado.", + + "joinroom-tooltip": "Sair da sala atual e ingressar na sala especificada.", + "seektime-msgbox-label": "Saltar para tempo especificado (em segundos ou minutos:segundos). Use + ou - para fazer um pulo relativo ao tempo atual.", + "ready-tooltip": "Indica se você está pronto para assistir.", + "autoplay-tooltip": "Reproduzir automaticamente quando todos os usuários que tiverem indicadores de prontidão estiverem prontos e o limiar de usuários for atingido.", + "switch-to-file-tooltip": "Clique duas vezes para mudar para {}", # Filename + "sendmessage-tooltip": "Mandar mensagem para a sala", + + # In-userlist notes (GUI) + "differentsize-note": "Tamanhos diferentes!", + "differentsizeandduration-note": "Tamanhos e durações diferentes!", + "differentduration-note": "Durações diferentes!", + "nofile-note": "(Nenhum arquivo está sendo tocado)", + + # Server messages to client + "new-syncplay-available-motd-message": "Você está usando o Syncplay {}, mas uma versão mais nova está disponível em https://syncplay.pl", # ClientVersion + + # Server notifications + "welcome-server-notification": "Seja bem-vindo ao servidor de Syncplay, versão {0}", # version + "client-connected-room-server-notification": "{0}({2}) conectou-se à sala '{1}'", # username, host, room + "client-left-server-notification": "{0} saiu do servidor", # name + "no-salt-notification": "POR FAVOR, NOTE: Para permitir que as senhas de operadores de sala geradas por esta instância do servidor ainda funcionem quando o servidor for reiniciado, por favor, adicione o seguinte argumento de linha de comando ao executar o servidor de Syncplay no futuro: --salt {}", # Salt + + + # Server arguments + "server-argument-description": 'Solução para sincronizar a reprodução de múltiplas instâncias de MPlayer e MPC-HC/BE pela rede. Instância de servidor', + "server-argument-epilog": 'Se nenhuma opção for fornecida, os valores de _config serão utilizados', + "server-port-argument": 'porta TCP do servidor', + "server-password-argument": 'senha do servidor', + "server-isolate-room-argument": 'salas devem ser isoladas?', + "server-salt-argument": "string aleatória utilizada para gerar senhas de salas gerenciadas", + "server-disable-ready-argument": "desativar recurso de prontidão", + "server-motd-argument": "caminho para o arquivo o qual o motd será obtido", + "server-chat-argument": "O chat deve ser desativado?", + "server-chat-maxchars-argument": "Número máximo de caracteres numa mensagem do chat (o padrão é {})", # Default number of characters + "server-maxusernamelength-argument": "Número máximos de caracteres num nome de usuário (o padrão é {})", + "server-stats-db-file-argument": "Habilita estatísticas de servidor usando o arquivo db SQLite fornecido", + "server-startTLS-argument": "Habilita conexões TLS usando os arquivos de certificado no caminho fornecido", + "server-messed-up-motd-unescaped-placeholders": "A Mensagem do Dia possui placeholders não escapados. Todos os sinais de $ devem ser dobrados (como em $$).", + "server-messed-up-motd-too-long": "A Mensagem do Dia é muito longa - máximo de {} caracteres, {} foram dados.", + + # Server errors + "unknown-command-server-error": "Comando desconhecido: {}", # message + "not-json-server-error": "Não é uma string codificada como json: {}", # message + "line-decode-server-error": "Não é uma string UTF-8", + "not-known-server-error": "Você deve ser conhecido pelo servidor antes de mandar este comando", + "client-drop-server-error": "Drop do client: {} -- {}", # host, error + "password-required-server-error": "Senha necessária", + "wrong-password-server-error": "Senha incorreta fornecida", + "hello-server-error": "Not enough Hello arguments", # DO NOT TRANSLATE + + # Playlists + "playlist-selection-changed-notification": "{} mudou a seleção da playlist", # Username + "playlist-contents-changed-notification": "{} atualizou playlist", # Username + "cannot-find-file-for-playlist-switch-error": "Não foi possível encontrar o arquivo {} no diretórios de mídia para a troca de playlist!", # Filename + "cannot-add-duplicate-error": "Não foi possível adicionar uma segunda entrada para '{}' para a playlist uma vez que duplicatas não são permitidas.", # Filename + "cannot-add-unsafe-path-error": "Não foi possível automaticamente carregar {} porque este não é um domínio confiado. Você pode trocar para a URL manualmente dando um clique duplo nela na playlist e adicionando o domínio aos domínios confiáveis em 'Arquivo -> Avançado -> Definir domínios confiáveis'. Se você clicar com o botão direito na URL, você pode adicionar esta URL como domínio confiável pelo menu de contexto.", # Filename + "sharedplaylistenabled-label": "Habilitar playlists compartilhadas", + "removefromplaylist-menu-label": "Remover da playlist", + "shuffleremainingplaylist-menu-label": "Embaralhar resto da playlist", + "shuffleentireplaylist-menu-label": "Embaralhar toda a playlist", + "undoplaylist-menu-label": "Desfazer última alteração à playlist", + "addfilestoplaylist-menu-label": "Adicionar arquivo(s) ao final da playlist", + "addurlstoplaylist-menu-label": "Adicionar URL(s) ao final da playlist", + "editplaylist-menu-label": "Editar playlist", + + "open-containing-folder": "Abrir pasta contendo este arquivo", + "addyourfiletoplaylist-menu-label": "Adicionar seu arquivo à playlist", + "addotherusersfiletoplaylist-menu-label": "Adicionar arquivos de {} à playlist", # [Username] + "addyourstreamstoplaylist-menu-label": "Adicionar sua transmissão à playlist", + "addotherusersstreamstoplaylist-menu-label": "Adicionar transmissão de {} à playlist", # [Username] + "openusersstream-menu-label": "Abrir transmissão de {}", # [username]'s + "openusersfile-menu-label": "Abrir arquivo de {}", # [username]'s + + "playlist-instruction-item-message": "Arraste um arquivo aqui para adicioná-lo à playlist compartilhada.", + "sharedplaylistenabled-tooltip": "Operadores da sala podem adicionar arquivos para a playlist compartilhada para tornar mais fácil para todo mundo assistir a mesma coisa. Configure os diretórios de mídia em 'Miscelânea'.", +} diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 5c0dc19..7d9b3a2 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -169,7 +169,7 @@ ru = { "file-argument": 'воспроизводимый файл', "args-argument": 'параметры проигрывателя; если нужно передать параметры, начинающиеся с - , то сначала пишите \'--\'', "clear-gui-data-argument": 'сбрасывает путь и данные о состоянии окна GUI, хранимые как QSettings', - "language-argument": 'язык сообщений Syncplay (de/en/ru/it/es)', + "language-argument": 'язык сообщений Syncplay (de/en/ru/it/es/pt_BR)', "version-argument": 'выводит номер версии', "version-message": "Вы используете Syncplay версии {} ({})", From 25314cb5528c6999d1b0145c1a3dfed7000d53d5 Mon Sep 17 00:00:00 2001 From: Alberto Sottile Date: Wed, 22 Apr 2020 19:56:07 +0200 Subject: [PATCH 058/112] macOS app: get system language from QLocale Fixes: #288 --- syncplay/messages.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/syncplay/messages.py b/syncplay/messages.py index f9fefac..a5e9b24 100755 --- a/syncplay/messages.py +++ b/syncplay/messages.py @@ -46,9 +46,15 @@ def getMissingStrings(): def getInitialLanguage(): - import locale try: - initialLanguage = locale.getdefaultlocale()[0].split("_")[0] + import sys + frozen = getattr(sys, 'frozen', '') + if frozen in 'macosx_app': + from PySide2.QtCore import QLocale + initialLanguage = QLocale.system().uiLanguages()[0].split('-')[0] + else: + import locale + initialLanguage = locale.getdefaultlocale()[0].split("_")[0] if initialLanguage not in messages: initialLanguage = constants.FALLBACK_INITIAL_LANGUAGE except: From ff6a6ad5a50180838fbd84c8f110d0b11495ff87 Mon Sep 17 00:00:00 2001 From: Etoh Date: Sat, 2 May 2020 15:51:15 +0100 Subject: [PATCH 059/112] Remove VLC --data-path to hopefully fix #301 & #302 Following suggestion from @bobismijnnaam in #301 --- syncplay/players/vlc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index 712387c..926c237 100755 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -407,7 +407,6 @@ class VlcPlayer(BasePlayer): playerController.vlcDataPath = "/usr/lib/syncplay/resources" else: playerController.vlcDataPath = utils.findWorkingDir() + "\\resources" - playerController.SLAVE_ARGS.append('--data-path={}'.format(playerController.vlcDataPath)) playerController.SLAVE_ARGS.append( '--lua-config=syncplay={{modulepath=\"{}\",port=\"{}\"}}'.format( playerController.vlcModulePath, str(playerController.vlcport))) From 3125032e824803ab3a9d2295146defc2cde5932f Mon Sep 17 00:00:00 2001 From: et0h Date: Sat, 2 May 2020 16:23:50 +0100 Subject: [PATCH 060/112] Add exception handling to media directory info update thread (#298) --- syncplay/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/syncplay/client.py b/syncplay/client.py index 5b60888..817047e 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -1975,6 +1975,8 @@ class FileSwitchManager(object): if self.mediaFilesCache != newMediaFilesCache: self.mediaFilesCache = newMediaFilesCache self.newInfo = True + except Exception as e: + self._client.ui.showDebugMessage(str(e)) finally: self.currentlyUpdating = False From 9d7996d7fd0a041a1b94eba5f2b04943c9baddbf Mon Sep 17 00:00:00 2001 From: prez Date: Sat, 2 May 2020 17:36:34 +0200 Subject: [PATCH 061/112] client: add simple wildcard matching mechanism for trusted domains (#306) to resolve #305 --- syncplay/client.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/syncplay/client.py b/syncplay/client.py index 817047e..236720d 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -506,6 +506,12 @@ class SyncplayClient(object): return False def isURITrusted(self, URIToTest): + def sWildcardMatch(a, b): + splt = a.split('*') + if len(splt) == 1: + return b.startswith(a) + return b.startswith(splt[0]) and b.endswith(splt[-1]) + URIToTest = URIToTest+"/" for trustedProtocol in constants.TRUSTABLE_WEB_PROTOCOLS: if URIToTest.startswith(trustedProtocol): @@ -513,7 +519,7 @@ class SyncplayClient(object): if self._config['trustedDomains']: for trustedDomain in self._config['trustedDomains']: trustableURI = ''.join([trustedProtocol, trustedDomain, "/"]) - if URIToTest.startswith(trustableURI): + if sWildcardMatch(trustableURI, URIToTest): return True return False else: From 7901542431777c7b5f3548f5dfb8d84754d1d5ec Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 13 May 2020 15:25:29 -0700 Subject: [PATCH 062/112] Fixed variables flipped around to resolve #281 (#311) --- syncplay/ui/GuiConfiguration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index c6f3a30..2e7715a 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -1054,7 +1054,7 @@ class ConfigDialog(QtWidgets.QDialog): font.setPointSize(self.config[configName + "RelativeFontSize"]) font.setWeight(self.config[configName + "FontWeight"]) font.setUnderline(self.config[configName + "FontUnderline"]) - value, ok = QtWidgets.QFontDialog.getFont(font) + ok, value = QtWidgets.QFontDialog.getFont(font) if ok: self.config[configName + "FontFamily"] = value.family() self.config[configName + "RelativeFontSize"] = value.pointSize() @@ -1420,7 +1420,7 @@ class ConfigDialog(QtWidgets.QDialog): if isMacOS(): initialHeight = self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+50 if self.error: - initialHeight += 40 + initialHeight += 40 self.setFixedWidth(self.sizeHint().width()) self.setFixedHeight(initialHeight) else: From 05f9a179dd56b5ebf42f8f126472fe8b1187fc88 Mon Sep 17 00:00:00 2001 From: Etoh Date: Thu, 14 May 2020 00:02:59 +0100 Subject: [PATCH 063/112] More reliably auto-identify as room operator (#216) --- syncplay/client.py | 1 - 1 file changed, 1 deletion(-) diff --git a/syncplay/client.py b/syncplay/client.py index 236720d..fbb8036 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -974,7 +974,6 @@ class SyncplayClient(object): else: return "" - @requireServerFeature("managedRooms") def identifyAsController(self, controlPassword): controlPassword = self.stripControlPassword(controlPassword) self.ui.showMessage(getMessage("identifying-as-controller-notification").format(controlPassword)) From 0e791559c5761e40bcd958608649fb1e6f100f38 Mon Sep 17 00:00:00 2001 From: daniel-123 Date: Fri, 15 May 2020 18:40:40 +0200 Subject: [PATCH 064/112] Assume CA bundle is UTF-8 encoded to fix #292 --- syncplay/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/client.py b/syncplay/client.py index fbb8036..7687874 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -759,7 +759,7 @@ class SyncplayClient(object): self._endpoint = HostnameEndpoint(reactor, host, port) try: caCertFP = open(os.environ['SSL_CERT_FILE']) - caCertTwisted = Certificate.loadPEM(caCertFP.read()) + caCertTwisted = Certificate.loadPEM(caCertFP.read().encode('utf-8') caCertFP.close() self.protocolFactory.options = optionsForClientTLS(hostname=host) self._clientSupportsTLS = True From b58a7d56a291b781504ec7dfb943e62456f206a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wr=C3=B3bel?= Date: Fri, 15 May 2020 18:58:15 +0200 Subject: [PATCH 065/112] Fixed typo --- syncplay/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/client.py b/syncplay/client.py index 7687874..dcc715a 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -759,7 +759,7 @@ class SyncplayClient(object): self._endpoint = HostnameEndpoint(reactor, host, port) try: caCertFP = open(os.environ['SSL_CERT_FILE']) - caCertTwisted = Certificate.loadPEM(caCertFP.read().encode('utf-8') + caCertTwisted = Certificate.loadPEM(caCertFP.read().encode('utf-8')) caCertFP.close() self.protocolFactory.options = optionsForClientTLS(hostname=host) self._clientSupportsTLS = True From 793e55ddbc2b092af112aa6b24c50891a2cd3053 Mon Sep 17 00:00:00 2001 From: Etoh Date: Fri, 15 May 2020 19:23:57 +0100 Subject: [PATCH 066/112] Move to JSON IPC API for mpv using iwaltons3's library (#261) (#310) * Separate mpv from mplayer, increase min mpv ver to >= 0.17, refactor * Further separation of mpv from mplayer * Fix reference to isASCII * Add iwalton3's Python MPV JSONIPC library (Apache 2.0) * Move to JSON IPC API for mpv using iwaltons3's library (#261) * Add empty init in Python MPV JSONIPC to make py2exe happy * Use managed version of Python MPV JSONIPC to improve initialisation reliability * Set mpv min version to >=0.29.0 to ensure compatibility * Allow mpv >=0.23.0 based on daniel-123's tests * Update mpv compatibility message * Revert to old OSC compat message * Removed mpv option that's no longer used afer switching to IPC. * Update python-mpv-jsonipc to v1.1.11 * Use python-mpv-jsonipc's mpv quit handler * Shorten mpv paused/position update message Co-authored-by: daniel-123 --- syncplay/constants.py | 14 +- syncplay/players/mpv.py | 470 ++++++++- syncplay/players/mpvnet.py | 4 +- .../players/python_mpv_jsonipc/LICENSE.md | 195 ++++ syncplay/players/python_mpv_jsonipc/README.md | 56 ++ .../players/python_mpv_jsonipc/__init__.py | 0 syncplay/players/python_mpv_jsonipc/docs.md | 460 +++++++++ .../python_mpv_jsonipc/python_mpv_jsonipc.py | 640 ++++++++++++ syncplay/players/python_mpv_jsonipc/setup.py | 25 + syncplay/resources/syncplayintf.lua | 12 + syncplay/resources/third-party-notices.rtf | 952 +++++++++--------- 11 files changed, 2281 insertions(+), 547 deletions(-) create mode 100644 syncplay/players/python_mpv_jsonipc/LICENSE.md create mode 100644 syncplay/players/python_mpv_jsonipc/README.md create mode 100644 syncplay/players/python_mpv_jsonipc/__init__.py create mode 100644 syncplay/players/python_mpv_jsonipc/docs.md create mode 100644 syncplay/players/python_mpv_jsonipc/python_mpv_jsonipc.py create mode 100644 syncplay/players/python_mpv_jsonipc/setup.py diff --git a/syncplay/constants.py b/syncplay/constants.py index 7cde152..42da8b0 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -235,9 +235,15 @@ USERLIST_GUI_USERNAME_COLUMN = 0 USERLIST_GUI_FILENAME_COLUMN = 3 MPLAYER_SLAVE_ARGS = ['-slave', '--hr-seek=always', '-nomsgcolor', '-msglevel', 'all=1:global=4:cplayer=4', '-af-add', 'scaletempo'] -MPV_ARGS = ['--force-window', '--idle', '--hr-seek=always', '--keep-open'] -MPV_SLAVE_ARGS = ['--msg-level=all=error,cplayer=info,term-msg=info', '--input-terminal=no', '--input-file=/dev/stdin'] -MPV_SLAVE_ARGS_NEW = ['--term-playing-msg=\nANS_filename=${filename}\nANS_length=${=duration:${=length:0}}\nANS_path=${path}\n', '--terminal=yes'] +MPV_ARGS = {'force-window': 'yes', + 'idle': 'yes', + 'hr-seek': 'always', + 'keep-open': 'yes', + 'input-terminal': 'no', + 'term-playing-msg': '\nANS_filename=${filename}\nANS_length=${=duration:${=length:0}}\nANS_path=${path}\n', + } + + MPV_NEW_VERSION = False MPV_OSC_VISIBILITY_CHANGE_VERSION = False MPV_INPUT_PROMPT_START_CHARACTER = "〉" @@ -261,7 +267,7 @@ VLC_SLAVE_ARGS = ['--extraintf=luaintf', '--lua-intf=syncplay', '--no-quiet', '- VLC_SLAVE_EXTRA_ARGS = getValueForOS({ OS_DEFAULT: ['--no-one-instance', '--no-one-instance-when-started-from-file'], OS_MACOS: ['--verbose=2', '--no-file-logging']}) -MPV_SUPERSEDE_IF_DUPLICATE_COMMANDS = ["no-osd set time-pos ", "loadfile "] +MPV_SUPERSEDE_IF_DUPLICATE_COMMANDS = ["set_property time-pos ", "loadfile "] MPV_REMOVE_BOTH_IF_DUPLICATE_COMMANDS = ["cycle pause"] MPLAYER_ANSWER_REGEX = "^ANS_([a-zA-Z_-]+)=(.+)$|^(Exiting)\.\.\. \((.+)\)$" VLC_ANSWER_REGEX = r"(?:^(?P[a-zA-Z_]+)(?:\: )?(?P.*))" diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index 68beb0d..eaeb66d 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -4,17 +4,30 @@ import re import sys import time import subprocess +import threading +import ast from syncplay import constants -from syncplay.players.mplayer import MplayerPlayer from syncplay.messages import getMessage from syncplay.utils import isURL, findResourcePath +from syncplay.utils import isMacOS, isWindows, isASCII +from syncplay.players.python_mpv_jsonipc.python_mpv_jsonipc import MPV +from syncplay.players.basePlayer import BasePlayer -class MpvPlayer(MplayerPlayer): +class MpvPlayer(BasePlayer): RE_VERSION = re.compile(r'.*mpv (\d+)\.(\d+)\.\d+.*') osdMessageSeparator = "\\n" osdMessageSeparator = "; " # TODO: Make conditional + POSITION_QUERY = 'time-pos' + OSD_QUERY = 'show_text' + RE_ANSWER = re.compile(constants.MPLAYER_ANSWER_REGEX) + lastResetTime = None + lastMPVPositionUpdate = None + alertOSDSupported = True + chatOSDSupported = True + speedSupported = True + customOpenDialog = False @staticmethod def run(client, playerPath, filePath, args): @@ -22,26 +35,41 @@ class MpvPlayer(MplayerPlayer): ver = MpvPlayer.RE_VERSION.search(subprocess.check_output([playerPath, '--version']).decode('utf-8')) except: ver = None - constants.MPV_NEW_VERSION = ver is None or int(ver.group(1)) > 0 or int(ver.group(2)) >= 6 + constants.MPV_NEW_VERSION = ver is None or int(ver.group(1)) > 0 or int(ver.group(2)) >= 23 + if not constants.MPV_NEW_VERSION: + from twisted.internet import reactor + the_reactor = reactor + the_reactor.callFromThread(client.ui.showErrorMessage, + "This version of mpv is not compatible with Syncplay. " + "Please use mpv >=0.23.0.", True) + the_reactor.callFromThread(client.stop) + return + constants.MPV_OSC_VISIBILITY_CHANGE_VERSION = False if ver is None else int(ver.group(1)) > 0 or int(ver.group(2)) >= 28 if not constants.MPV_OSC_VISIBILITY_CHANGE_VERSION: client.ui.showDebugMessage( "This version of mpv is not known to be compatible with changing the OSC visibility. " "Please use mpv >=0.28.0.") - if constants.MPV_NEW_VERSION: - return NewMpvPlayer(client, MpvPlayer.getExpandedPath(playerPath), filePath, args) - else: - return OldMpvPlayer(client, MpvPlayer.getExpandedPath(playerPath), filePath, args) + return MpvPlayer(client, MpvPlayer.getExpandedPath(playerPath), filePath, args) @staticmethod - def getStartupArgs(path, userArgs): + def getStartupArgs(userArgs): args = constants.MPV_ARGS + args["script"] = findResourcePath("syncplayintf.lua") if userArgs: - args.extend(userArgs) - args.extend(constants.MPV_SLAVE_ARGS) - if constants.MPV_NEW_VERSION: - args.extend(constants.MPV_SLAVE_ARGS_NEW) - args.extend(["--script={}".format(findResourcePath("syncplayintf.lua"))]) + for argToAdd in userArgs: + if argToAdd.startswith('--'): + argToAdd = argToAdd[2:] + elif argToAdd.startswith('-'): + argToAdd = argToAdd[1:] + if argToAdd.strip() == "": + continue + if "=" in argToAdd: + (argName, argValue) = argToAdd.split("=") + else: + argName = argToAdd + argValue = "yes" + args[argName] = argValue return args @staticmethod @@ -83,18 +111,8 @@ class MpvPlayer(MplayerPlayer): def getPlayerPathErrors(playerPath, filePath): return None - -class OldMpvPlayer(MpvPlayer): - POSITION_QUERY = 'time-pos' - OSD_QUERY = 'show_text' - def _setProperty(self, property_, value): - self._listener.sendLine("no-osd set {} {}".format(property_, value)) - - def setPaused(self, value): - if self._paused != value: - self._paused = not self._paused - self._listener.sendLine('cycle pause') + self._listener.sendLine(["set_property", property_, value]) def mpvErrorCheck(self, line): if "Error parsing option" in line or "Error parsing commandline option" in line: @@ -107,41 +125,30 @@ class OldMpvPlayer(MpvPlayer): if constants and any(errormsg in line for errormsg in constants.MPV_ERROR_MESSAGES_TO_REPEAT): self._client.ui.showErrorMessage(line) - def _handleUnknownLine(self, line): - self.mpvErrorCheck(line) - if "Playing: " in line: - newpath = line[9:] - oldpath = self._filepath - if newpath != oldpath and oldpath is not None: - self.reactor.callFromThread(self._onFileUpdate) - if self._paused != self._client.getGlobalPaused(): - self.setPaused(self._client.getGlobalPaused()) - self.setPosition(self._client.getGlobalPosition()) - - -class NewMpvPlayer(OldMpvPlayer): - lastResetTime = None - lastMPVPositionUpdate = None - alertOSDSupported = True - chatOSDSupported = True - def displayMessage(self, message, duration=(constants.OSD_DURATION * 1000), OSDType=constants.OSD_NOTIFICATION, mood=constants.MESSAGE_NEUTRAL): if not self._client._config["chatOutputEnabled"]: - MplayerPlayer.displayMessage(self, message=message, duration=duration, OSDType=OSDType, mood=mood) + messageString = self._sanitizeText(message.replace("\\n", "")).replace("", "\\n") + self._listener.mpvpipe.show_text(messageString, duration, constants.MPLAYER_OSD_LEVEL) return messageString = self._sanitizeText(message.replace("\\n", "")).replace( "\\\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER).replace("", "\\n") - self._listener.sendLine('script-message-to syncplayintf {}-osd-{} "{}"'.format(OSDType, mood, messageString)) + self._listener.sendLine(["script-message-to", "syncplayintf", "{}-osd-{}".format(OSDType, mood), messageString]) def displayChatMessage(self, username, message): if not self._client._config["chatOutputEnabled"]: - MplayerPlayer.displayChatMessage(self, username, message) + messageString = "<{}> {}".format(username, message) + messageString = self._sanitizeText(messageString.replace("\\n", "")).replace("", "\\n") + duration = int(constants.OSD_DURATION * 1000) + self._listener.mpvpipe.show_text(messageString, duration, constants.MPLAYER_OSD_LEVEL) return username = self._sanitizeText(username.replace("\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER)) message = self._sanitizeText(message.replace("\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER)) messageString = "<{}> {}".format(username, message) - self._listener.sendLine('script-message-to syncplayintf chat "{}"'.format(messageString)) + self._listener.sendLine(["script-message-to", "syncplayintf", "chat", messageString]) + + def setSpeed(self, value): + self._setProperty('speed', "{:.2f}".format(value)) def setPaused(self, value): if self._paused == value: @@ -153,6 +160,15 @@ class NewMpvPlayer(OldMpvPlayer): if value == False: self.lastMPVPositionUpdate = time.time() + def _getFilename(self): + self._getProperty('filename') + + def _getLength(self): + self._getProperty('length') + + def _getFilepath(self): + self._getProperty('path') + def _getProperty(self, property_): floatProperties = ['time-pos'] if property_ in floatProperties: @@ -161,7 +177,7 @@ class NewMpvPlayer(OldMpvPlayer): propertyID = '=duration:${=length:0}' else: propertyID = property_ - self._listener.sendLine("print_text ""ANS_{}=${{{}}}""".format(property_, propertyID)) + self._listener.sendLine(["print_text", '"ANS_{}=${{{}}}"'.format(property_, propertyID)]) def getCalculatedPosition(self): if self.fileLoaded == False: @@ -197,6 +213,10 @@ class NewMpvPlayer(OldMpvPlayer): return self._position def _storePosition(self, value): + if value is None: + self._client.ui.showDebugMessage("NONE TYPE POSITION!") + return + if self._client.isPlayingMusic() and self._paused == False and self._position == value and abs(self._position-self._position) < 0.5: self._client.ui.showDebugMessage("EOF DETECTED!") self._position = 0 @@ -206,17 +226,79 @@ class NewMpvPlayer(OldMpvPlayer): self._client.ui.showDebugMessage("Recently reset, so storing position as 0") self._position = 0 elif self._fileIsLoaded() or (value < constants.MPV_NEWFILE_IGNORE_TIME and self._fileIsLoaded(ignoreDelay=True)): + old_position = float(self._position) self._position = max(value, 0) + #self._client.ui.showDebugMessage("Position changed from {} to {}".format(old_position, self._position)) else: self._client.ui.showDebugMessage( - "No file loaded so storing position as GlobalPosition ({})".format(self._client.getGlobalPosition())) + "No file loaded so storing position {} as GlobalPosition ({})".format(value, self._client.getGlobalPosition())) self._position = self._client.getGlobalPosition() def _storePauseState(self, value): + if value is None: + self._client.ui.showDebugMessage("NONE TYPE PAUSE STATE!") + return if self._fileIsLoaded(): self._paused = value + #self._client.ui.showDebugMessage("PAUSE STATE STORED AS {}".format(self._paused)) else: self._paused = self._client.getGlobalPaused() + #self._client.ui.showDebugMessage("STORING GLOBAL PAUSED AS FILE IS NOT LOADED") + + + def lineReceived(self, line): + if line: + self._client.ui.showDebugMessage("player << {}".format(line)) + line = line.replace("[cplayer] ", "") # -v workaround + line = line.replace("[term-msg] ", "") # -v workaround + line = line.replace(" cplayer: ", "") # --msg-module workaround + line = line.replace(" term-msg: ", "") + if ( + "Failed to get value of property" in line or + "=(unavailable)" in line or + line == "ANS_filename=" or + line == "ANS_length=" or + line == "ANS_path=" + ): + if "filename" in line: + self._getFilename() + elif "length" in line: + self._getLength() + elif "path" in line: + self._getFilepath() + return + match = self.RE_ANSWER.match(line) + if not match: + self._handleUnknownLine(line) + return + + name, value = [m for m in match.groups() if m] + name = name.lower() + + if name == self.POSITION_QUERY: + self._storePosition(float(value)) + self._positionAsk.set() + elif name == "pause": + self._storePauseState(bool(value == 'yes')) + self._pausedAsk.set() + elif name == "length": + try: + self._duration = float(value) + except: + self._duration = 0 + self._durationAsk.set() + elif name == "path": + self._filepath = value + self._pathAsk.set() + elif name == "filename": + self._filename = value + self._filenameAsk.set() + elif name == "exiting": + if value != 'Quit': + if self.quitReason is None: + self.quitReason = getMessage("media-player-error").format(value) + self.reactor.callFromThread(self._client.ui.showErrorMessage, self.quitReason, True) + self.drop() def askForStatus(self): self._positionAsk.clear() @@ -231,8 +313,47 @@ class NewMpvPlayer(OldMpvPlayer): self._client.updatePlayerStatus( self._paused if self.fileLoaded else self._client.getGlobalPaused(), self.getCalculatedPosition()) + def drop(self): + self._listener.sendLine(['quit']) + self._takeLocksDown() + self.reactor.callFromThread(self._client.stop, False) + + def _takeLocksDown(self): + self._durationAsk.set() + self._filenameAsk.set() + self._pathAsk.set() + self._positionAsk.set() + self._pausedAsk.set() + + def _getPausedAndPosition(self): - self._listener.sendLine("print_text ANS_pause=${pause}\r\nprint_text ANS_time-pos=${=time-pos}") + self._listener.sendLine(["script-message-to", "syncplayintf", "get_paused_and_position"]) + + def _getPaused(self): + self._getProperty('pause') + + def _getPosition(self): + self._getProperty(self.POSITION_QUERY) + + def _sanitizeText(self, text): + text = text.replace("\r", "") + text = text.replace("\n", "") + text = text.replace("\\\"", "") + text = text.replace("\"", "") + text = text.replace("%", "%%") + text = text.replace("\\", "\\\\") + text = text.replace("{", "\\\\{") + text = text.replace("}", "\\\\}") + text = text.replace("", "\\\"") + return text + + def _quoteArg(self, arg): + arg = arg.replace('\\', '\\\\') + arg = arg.replace("'", "\\'") + arg = arg.replace('"', '\\"') + arg = arg.replace("\r", "") + arg = arg.replace("\n", "") + return '"{}"'.format(arg) def _preparePlayer(self): if self.delayedFilePath: @@ -246,7 +367,7 @@ class NewMpvPlayer(OldMpvPlayer): def _loadFile(self, filePath): self._clearFileLoaded() - self._listener.sendLine('loadfile {}'.format(self._quoteArg(filePath)), notReadyAfterThis=True) + self._listener.sendLine(['loadfile', filePath], notReadyAfterThis=True) def setFeatures(self, featureList): self.sendMpvOptions() @@ -256,7 +377,11 @@ class NewMpvPlayer(OldMpvPlayer): self._client.ui.showDebugMessage( "Did not seek as recently reset and {} below 'do not reset position' threshold".format(value)) return - MplayerPlayer.setPosition(self, value) + self._position = max(value, 0) + self._client.ui.showDebugMessage( + "Setting position to {}...".format(self._position)) + self._setProperty(self.POSITION_QUERY, "{}".format(value)) + time.sleep(0.03) self.lastMPVPositionUpdate = time.time() def openFile(self, filePath, resetPosition=False): @@ -264,6 +389,7 @@ class NewMpvPlayer(OldMpvPlayer): if resetPosition: self.lastResetTime = time.time() if isURL(filePath): + self._client.ui.showDebugMessage("Setting additional lastResetTime due to stream") self.lastResetTime += constants.STREAM_ADDITIONAL_IGNORE_TIME self._loadFile(filePath) if self._paused != self._client.getGlobalPaused(): @@ -271,9 +397,11 @@ class NewMpvPlayer(OldMpvPlayer): else: self._client.ui.showDebugMessage("Don't want to set paused to {}".format(self._client.getGlobalPaused())) if resetPosition == False: + self._client.ui.showDebugMessage("OpenFile setting position to global position: {}".format(self._client.getGlobalPosition())) self.setPosition(self._client.getGlobalPosition()) else: self._storePosition(0) + # TO TRY: self._listener.setReadyToSend(False) def sendMpvOptions(self): options = [] @@ -285,7 +413,7 @@ class NewMpvPlayer(OldMpvPlayer): options.append("{}={}".format(option, getMessage(option))) options.append("OscVisibilityChangeCompatible={}".format(constants.MPV_OSC_VISIBILITY_CHANGE_VERSION)) options_string = ", ".join(options) - self._listener.sendLine('script-message-to syncplayintf set_syncplayintf_options "{}"'.format(options_string)) + self._listener.sendLine(["script-message-to", "syncplayintf", "set_syncplayintf_options", options_string]) self._setOSDPosition() def _handleUnknownLine(self, line): @@ -295,18 +423,37 @@ class NewMpvPlayer(OldMpvPlayer): line = line.replace(constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER, "\\") self._listener.sendChat(line[6:-7]) + if "", "<").replace("=", "<").replace(", ", "<").split("<") + paused_update = update_string[2] + position_update = update_string[4] + if paused_update == "nil": + self._storePauseState(True) + else: + self._storePauseState(bool(paused_update == 'true')) + self._pausedAsk.set() + if position_update == "nil": + self._storePosition(float(0)) + else: + self._storePosition(float(position_update)) + self._positionAsk.set() + #self._client.ui.showDebugMessage("{} = {} / {}".format(update_string, paused_update, position_update)) + if "" in line: self.sendMpvOptions() if line == "" or "Playing:" in line: + self._client.ui.showDebugMessage("Not ready to send due to ") self._listener.setReadyToSend(False) self._clearFileLoaded() elif line == "": self._onFileUpdate() self._listener.setReadyToSend(True) + self._client.ui.showDebugMessage("Ready to send due to ") elif "Failed" in line or "failed" in line or "No video or audio streams selected" in line or "error" in line: + self._client.ui.showDebugMessage("Not ready to send due to error") self._listener.setReadyToSend(True) def _setOSDPosition(self): @@ -330,12 +477,15 @@ class NewMpvPlayer(OldMpvPlayer): return False def _onFileUpdate(self): + self._client.ui.showDebugMessage("File update") self.fileLoaded = True self.lastLoadedTime = time.time() self.reactor.callFromThread(self._client.updateFile, self._filename, self._duration, self._filepath) if not (self._recentlyReset()): + self._client.ui.showDebugMessage("onFileUpdate setting position to global position: {}".format(self._client.getGlobalPosition())) self.reactor.callFromThread(self.setPosition, self._client.getGlobalPosition()) if self._paused != self._client.getGlobalPaused(): + self._client.ui.showDebugMessage("onFileUpdate setting position to global paused: {}".format(self._client.getGlobalPaused())) self.reactor.callFromThread(self._client.getGlobalPaused) def _fileIsLoaded(self, ignoreDelay=False): @@ -347,3 +497,219 @@ class NewMpvPlayer(OldMpvPlayer): self.fileLoaded and self.lastLoadedTime is not None and time.time() > (self.lastLoadedTime + constants.MPV_NEWFILE_IGNORE_TIME) ) + + + def __init__(self, client, playerPath, filePath, args): + from twisted.internet import reactor + self.reactor = reactor + self._client = client + self._paused = None + self._position = 0.0 + self._duration = None + self._filename = None + self._filepath = None + self.quitReason = None + self.lastLoadedTime = None + self.fileLoaded = False + self.delayedFilePath = None + try: + self._listener = self.__Listener(self, playerPath, filePath, args) + except ValueError: + self._client.ui.showMessage(getMessage("mplayer-file-required-notification")) + self._client.ui.showMessage(getMessage("mplayer-file-required-notification/example")) + self.drop() + return + self._listener.setDaemon(True) + self._listener.start() + + self._durationAsk = threading.Event() + self._filenameAsk = threading.Event() + self._pathAsk = threading.Event() + + self._positionAsk = threading.Event() + self._pausedAsk = threading.Event() + + self._preparePlayer() + + def _fileUpdateClearEvents(self): + self._durationAsk.clear() + self._filenameAsk.clear() + self._pathAsk.clear() + + def _fileUpdateWaitEvents(self): + self._durationAsk.wait() + self._filenameAsk.wait() + self._pathAsk.wait() + + def mpv_log_handler(self, level, prefix, text): + self.lineReceived(text) + + class __Listener(threading.Thread): + def __init__(self, playerController, playerPath, filePath, args): + self.playerPath = playerPath + self.mpv_arguments = playerController.getStartupArgs(args) + self.mpv_running = True + self.sendQueue = [] + self.readyToSend = True + self.lastSendTime = None + self.lastNotReadyTime = None + self.__playerController = playerController + if not self.__playerController._client._config["chatOutputEnabled"]: + self.__playerController.alertOSDSupported = False + self.__playerController.chatOSDSupported = False + if self.__playerController.getPlayerPathErrors(playerPath, filePath): + raise ValueError() + if filePath and '://' not in filePath: + if not os.path.isfile(filePath) and 'PWD' in os.environ: + filePath = os.environ['PWD'] + os.path.sep + filePath + filePath = os.path.realpath(filePath) + + if filePath: + self.__playerController.delayedFilePath = filePath + + # At least mpv may output escape sequences which result in syncplay + # trying to parse something like + # "\x1b[?1l\x1b>ANS_filename=blah.mkv". Work around this by + # unsetting TERM. + env = os.environ.copy() + if 'TERM' in env: + del env['TERM'] + # On macOS, youtube-dl requires system python to run. Set the environment + # to allow that version of python to be executed in the mpv subprocess. + if isMacOS(): + try: + pythonLibs = subprocess.check_output(['/usr/bin/python', '-E', '-c', + 'import sys; print(sys.path)'], + text=True, env=dict()) + pythonLibs = ast.literal_eval(pythonLibs) + pythonPath = ':'.join(pythonLibs[1:]) + except: + pythonPath = None + if pythonPath is not None: + env['PATH'] = '/usr/bin:/usr/local/bin' + env['PYTHONPATH'] = pythonPath + self.mpvpipe = MPV(mpv_location=self.playerPath, loglevel="info", log_handler=self.__playerController.mpv_log_handler, quit_callback=self.stop_client, **self.mpv_arguments) + self.__process = self.mpvpipe + #self.mpvpipe.show_text("HELLO WORLD!", 1000) + threading.Thread.__init__(self, name="MPV Listener") + + def __getCwd(self, filePath, env): + if not filePath: + return None + if os.path.isfile(filePath): + cwd = os.path.dirname(filePath) + elif 'HOME' in env: + cwd = env['HOME'] + elif 'APPDATA' in env: + cwd = env['APPDATA'] + else: + cwd = None + return cwd + + def run(self): + pass + + def sendChat(self, message): + if message: + if message[:1] == "/" and message != "/": + command = message[1:] + if command and command[:1] == "/": + message = message[1:] + else: + self.__playerController.reactor.callFromThread( + self.__playerController._client.ui.executeCommand, command) + return + self.__playerController.reactor.callFromThread(self.__playerController._client.sendChat, message) + + def isReadyForSend(self): + self.checkForReadinessOverride() + return self.readyToSend + + def setReadyToSend(self, newReadyState): + oldState = self.readyToSend + self.readyToSend = newReadyState + self.lastNotReadyTime = time.time() if newReadyState == False else None + if self.readyToSend == True: + self.__playerController._client.ui.showDebugMessage(" Ready to send: True") + else: + self.__playerController._client.ui.showDebugMessage(" Ready to send: False") + if self.readyToSend == True and oldState == False: + self.processSendQueue() + + def checkForReadinessOverride(self): + if self.lastNotReadyTime and time.time() - self.lastNotReadyTime > constants.MPV_MAX_NEWFILE_COOLDOWN_TIME: + self.setReadyToSend(True) + + def sendLine(self, line, notReadyAfterThis=None): + self.checkForReadinessOverride() + try: + if self.sendQueue: + if constants.MPV_SUPERSEDE_IF_DUPLICATE_COMMANDS: + for command in constants.MPV_SUPERSEDE_IF_DUPLICATE_COMMANDS: + line_command = " ".join(line) + answer = line_command.startswith(command) + #self.__playerController._client.ui.showDebugMessage("Does line_command {} start with {}? {}".format(line_command, command, answer)) + if line_command.startswith(command): + for itemID, deletionCandidate in enumerate(self.sendQueue): + if " ".join(deletionCandidate).startswith(command): + self.__playerController._client.ui.showDebugMessage( + " Remove duplicate (supersede): {}".format(self.sendQueue[itemID])) + try: + self.sendQueue.remove(self.sendQueue[itemID]) + except UnicodeWarning: + self.__playerController._client.ui.showDebugMessage( + " Unicode mismatch occured when trying to remove duplicate") + # TODO: Prevent this from being triggered + pass + break + break + if constants.MPV_REMOVE_BOTH_IF_DUPLICATE_COMMANDS: + for command in constants.MPV_REMOVE_BOTH_IF_DUPLICATE_COMMANDS: + if line == command: + for itemID, deletionCandidate in enumerate(self.sendQueue): + if deletionCandidate == command: + self.__playerController._client.ui.showDebugMessage( + " Remove duplicate (delete both): {}".format(self.sendQueue[itemID])) + self.__playerController._client.ui.showDebugMessage(self.sendQueue[itemID]) + return + except Exception as e: + self.__playerController._client.ui.showDebugMessage(" Problem removing duplicates, etc: {}".format(e)) + self.sendQueue.append(line) + self.processSendQueue() + if notReadyAfterThis: + self.setReadyToSend(False) + + def processSendQueue(self): + while self.sendQueue and self.readyToSend: + if self.lastSendTime and time.time() - self.lastSendTime < constants.MPV_SENDMESSAGE_COOLDOWN_TIME: + self.__playerController._client.ui.showDebugMessage( + " Throttling message send, so sleeping for {}".format( + constants.MPV_SENDMESSAGE_COOLDOWN_TIME)) + time.sleep(constants.MPV_SENDMESSAGE_COOLDOWN_TIME) + try: + lineToSend = self.sendQueue.pop() + if lineToSend: + self.lastSendTime = time.time() + self.actuallySendLine(lineToSend) + except IndexError: + pass + + def stop_client(self): + self.readyToSend = False + try: + self.mpvpipe.terminate() + except: #When mpv is already closed + pass + self.__playerController._takeLocksDown() + self.__playerController.reactor.callFromThread(self.__playerController._client.stop, False) + + def actuallySendLine(self, line): + try: + self.__playerController._client.ui.showDebugMessage("player >> {}".format(line)) + try: + self.mpvpipe.command(*line) + except Exception as e: + self.__playerController._client.ui.showDebugMessage("CANNOT SEND {} DUE TO {}".format(line, e)) + self.stop_client() + except IOError: + pass diff --git a/syncplay/players/mpvnet.py b/syncplay/players/mpvnet.py index 5813e37..41088d5 100644 --- a/syncplay/players/mpvnet.py +++ b/syncplay/players/mpvnet.py @@ -1,8 +1,8 @@ import os from syncplay import constants -from syncplay.players.mpv import NewMpvPlayer +from syncplay.players.mpv import MpvPlayer -class MpvnetPlayer(NewMpvPlayer): +class MpvnetPlayer(MpvPlayer): @staticmethod diff --git a/syncplay/players/python_mpv_jsonipc/LICENSE.md b/syncplay/players/python_mpv_jsonipc/LICENSE.md new file mode 100644 index 0000000..f5f4b8b --- /dev/null +++ b/syncplay/players/python_mpv_jsonipc/LICENSE.md @@ -0,0 +1,195 @@ +Apache License +============== + +_Version 2.0, January 2004_ +_<>_ + +### Terms and Conditions for use, reproduction, and distribution + +#### 1. Definitions + +“License” shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +“Licensor” shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +“Legal Entity” shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, “control” means **(i)** the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the +outstanding shares, or **(iii)** beneficial ownership of such entity. + +“You” (or “Your”) shall mean an individual or Legal Entity exercising +permissions granted by this License. + +“Source” form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +“Object” form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +“Work” shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +“Derivative Works” shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +“Contribution” shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +“submitted” means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as “Not a Contribution.” + +“Contributor” shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +#### 2. Grant of Copyright License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +#### 3. Grant of Patent License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +#### 4. Redistribution + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +* **(a)** You must give any other recipients of the Work or Derivative Works a copy of +this License; and +* **(b)** You must cause any modified files to carry prominent notices stating that You +changed the files; and +* **(c)** You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. + +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +#### 5. Submission of Contributions + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +#### 6. Trademarks + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +#### 7. Disclaimer of Warranty + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +#### 8. Limitation of Liability + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +#### 9. Accepting Warranty or Additional Liability + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +_END OF TERMS AND CONDITIONS_ + +### APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets `[]` replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same “printed page” as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/syncplay/players/python_mpv_jsonipc/README.md b/syncplay/players/python_mpv_jsonipc/README.md new file mode 100644 index 0000000..cc3cea7 --- /dev/null +++ b/syncplay/players/python_mpv_jsonipc/README.md @@ -0,0 +1,56 @@ +# Python MPV JSONIPC + +This implements an interface similar to `python-mpv`, but it uses the JSON IPC protocol instead of the C API. This means +you can control external instances of MPV including players like SMPlayer, and it can use MPV players that are prebuilt +instead of needing `libmpv1`. It may also be more resistant to crashes such as Segmentation Faults, but since it isn't +directly communicating with MPV via the C API the performance will be worse. + +Please note that this only implements the subset of `python-mpv` that is used by `plex-mpv-shim` and +`jellyfin-mpv-shim`. Other functionality has not been implemented. + +## Installation + +```bash +sudo pip3 install python-mpv-jsonipc +``` + +## Basic usage + +Create an instance of MPV. You can use an already running MPV or have the library start a +managed copy of MPV. Command arguments can be specified when initializing MPV if you are +starting a managed copy of MPV. + +Please also see the [API Documentation](https://github.com/iwalton3/python-mpv-jsonipc/blob/master/docs.md). + +```python +from python_mpv_jsonipc import MPV + +# Uses MPV that is in the PATH. +mpv = MPV() + +# Use MPV that is running and connected to /tmp/mpv-socket. +mpv = MPV(start_mpv=False, ipc_socket="/tmp/mpv-socket") + +# Uses MPV that is found at /path/to/mpv. +mpv = MPV(mpv_location="/path/to/mpv") + +# After you have an MPV, you can read and set (if applicable) properties. +mpv.volume # 100.0 by default +mpv.volume = 20 + +# You can also send commands. +mpv.command_name(arg1, arg2) + +# Bind to key press events with a decorator +@mpv.on_key_press("space") +def space_handler(): + pass + +# You can also observe and wait for properties. +@mpv.property_observer("eof-reached") +def handle_eof(name, value): + pass + +# Or simply wait for the value to change once. +mpv.wait_for_property("duration") +``` diff --git a/syncplay/players/python_mpv_jsonipc/__init__.py b/syncplay/players/python_mpv_jsonipc/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/syncplay/players/python_mpv_jsonipc/docs.md b/syncplay/players/python_mpv_jsonipc/docs.md new file mode 100644 index 0000000..e3146c9 --- /dev/null +++ b/syncplay/players/python_mpv_jsonipc/docs.md @@ -0,0 +1,460 @@ + + +## python\_mpv\_jsonipc + + + +### MPVError + +``` python +class MPVError(Exception): + | MPVError(**args, ****kwargs) +``` + +An error originating from MPV or due to a problem with MPV. + + + +### WindowsSocket + +``` python +class WindowsSocket(threading.Thread) +``` + +Wraps a Windows named pipe in a high-level interface. (Internal) + +Data is automatically encoded and decoded as JSON. The callback +function will be called for each inbound message. + + + +#### \_\_init\_\_ + +``` python + | __init__(ipc_socket, callback=None, quit_callback=None) +``` + +Create the wrapper. + +**ipc\_socket** is the pipe name. (Not including \\\\.\\pipe\\) +**callback(json\_data)** is the function for recieving events. + + + +#### stop + +``` python + | stop() +``` + +Terminate the thread. + + + +#### send + +``` python + | send(data) +``` + +Send **data** to the pipe, encoded as JSON. + + + +#### run + +``` python + | run() +``` + +Process pipe events. Do not run this directly. Use **start**. + + + +### UnixSocket + +``` python +class UnixSocket(threading.Thread) +``` + +Wraps a Unix/Linux socket in a high-level interface. (Internal) + +Data is automatically encoded and decoded as JSON. The callback +function will be called for each inbound message. + + + +#### \_\_init\_\_ + +``` python + | __init__(ipc_socket, callback=None, quit_callback=None) +``` + +Create the wrapper. + +**ipc\_socket** is the path to the socket. +**callback(json\_data)** is the function for recieving events. + + + +#### stop + +``` python + | stop() +``` + +Terminate the thread. + + + +#### send + +``` python + | send(data) +``` + +Send **data** to the socket, encoded as JSON. + + + +#### run + +``` python + | run() +``` + +Process socket events. Do not run this directly. Use **start**. + + + +### MPVProcess + +``` python +class MPVProcess() +``` + +Manages an MPV process, ensuring the socket or pipe is available. (Internal) + + + +#### \_\_init\_\_ + +``` python + | __init__(ipc_socket, mpv_location=None, ****kwargs) +``` + +Create and start the MPV process. Will block until socket/pipe is available. + +**ipc\_socket** is the path to the Unix/Linux socket or name of the Windows pipe. +**mpv\_location** is the path to mpv. If left unset it tries the one in the PATH. + +All other arguments are forwarded to MPV as command-line arguments. + + + +#### stop + +``` python + | stop() +``` + +Terminate the process. + + + +### MPVInter + +``` python +class MPVInter() +``` + +Low-level interface to MPV. Does NOT manage an mpv process. (Internal) + + + +#### \_\_init\_\_ + +``` python + | __init__(ipc_socket, callback=None, quit_callback=None) +``` + +Create the wrapper. + +**ipc\_socket** is the path to the Unix/Linux socket or name of the Windows pipe. +**callback(event\_name, data)** is the function for recieving events. + + + +#### stop + +``` python + | stop() +``` + +Terminate the underlying connection. + + + +#### event\_callback + +``` python + | event_callback(data) +``` + +Internal callback for recieving events from MPV. + + + +#### command + +``` python + | command(command, **args) +``` + +Issue a command to MPV. Will block until completed or timeout is reached. + +**command** is the name of the MPV command + +All further arguments are forwarded to the MPV command. +Throws TimeoutError if timeout of 120 seconds is reached. + + + +### EventHandler + +``` python +class EventHandler(threading.Thread) +``` + +Event handling thread. (Internal) + + + +#### \_\_init\_\_ + +``` python + | __init__() +``` + +Create an instance of the thread. + + + +#### put\_task + +``` python + | put_task(func, **args) +``` + +Put a new task to the thread. + +**func** is the function to call + +All further arguments are forwarded to **func**. + + + +#### stop + +``` python + | stop() +``` + +Terminate the thread. + + + +#### run + +``` python + | run() +``` + +Process socket events. Do not run this directly. Use **start**. + + + +### MPV + +``` python +class MPV() +``` + +The main MPV interface class. Use this to control MPV. + +This will expose all mpv commands as callable methods and all properties. +You can set properties and call the commands directly. + +Please note that if you are using a really old MPV version, a fallback command +list is used. Not all commands may actually work when this fallback is used. + + + +#### \_\_init\_\_ + +``` python + | __init__(start_mpv=True, ipc_socket=None, mpv_location=None, log_handler=None, loglevel=None, quit_callback=None, ****kwargs) +``` + +Create the interface to MPV and process instance. + +**start\_mpv** will start an MPV process if true. (Default: True) +**ipc\_socket** is the path to the Unix/Linux socket or name of Windows pipe. (Default: Random Temp File) +**mpv\_location** is the location of MPV for **start\_mpv**. (Default: Use MPV in PATH) +**log\_handler(level, prefix, text)** is an optional handler for log events. (Default: Disabled) +**loglevel** is the level for log messages. Levels are fatal, error, warn, info, v, debug, trace. (Default: Disabled) + +All other arguments are forwarded to MPV as command-line arguments if **start\_mpv** is used. + + + +#### bind\_event + +``` python + | bind_event(name, callback) +``` + +Bind a callback to an MPV event. + +**name** is the MPV event name. +**callback(event\_data)** is the function to call. + + + +#### on\_event + +``` python + | on_event(name) +``` + +Decorator to bind a callback to an MPV event. + +@on\_event(name) +def my\_callback(event\_data): +pass + + + +#### event\_callback + +``` python + | event_callback(name) +``` + +An alias for on\_event to maintain compatibility with python-mpv. + + + +#### on\_key\_press + +``` python + | on_key_press(name) +``` + +Decorator to bind a callback to an MPV keypress event. + +@on\_key\_press(key\_name) +def my\_callback(): +pass + + + +#### bind\_key\_press + +``` python + | bind_key_press(name, callback) +``` + +Bind a callback to an MPV keypress event. + +**name** is the key symbol. +**callback()** is the function to call. + + + +#### bind\_property\_observer + +``` python + | bind_property_observer(name, callback) +``` + +Bind a callback to an MPV property change. + +**name** is the property name. +**callback(name, data)** is the function to call. + +Returns a unique observer ID needed to destroy the observer. + + + +#### unbind\_property\_observer + +``` python + | unbind_property_observer(observer_id) +``` + +Remove callback to an MPV property change. + +**observer\_id** is the id returned by bind\_property\_observer. + + + +#### property\_observer + +``` python + | property_observer(name) +``` + +Decorator to bind a callback to an MPV property change. + +@property\_observer(property\_name) +def my\_callback(name, data): +pass + + + +#### wait\_for\_property + +``` python + | wait_for_property(name) +``` + +Waits for the value of a property to change. + +**name** is the name of the property. + + + +#### play + +``` python + | play(url) +``` + +Play the specified URL. An alias to loadfile(). + + + +#### terminate + +``` python + | terminate() +``` + +Terminate the connection to MPV and process (if **start\_mpv** is used). + + + +#### command + +``` python + | command(command, **args) +``` + +Send a command to MPV. All commands are bound to the class by default, +except JSON IPC specific commands. This may also be useful to retain +compatibility with python-mpv, as it does not bind all of the commands. + +**command** is the command name. + +All further arguments are forwarded to the MPV command. diff --git a/syncplay/players/python_mpv_jsonipc/python_mpv_jsonipc.py b/syncplay/players/python_mpv_jsonipc/python_mpv_jsonipc.py new file mode 100644 index 0000000..993606b --- /dev/null +++ b/syncplay/players/python_mpv_jsonipc/python_mpv_jsonipc.py @@ -0,0 +1,640 @@ +import threading +import socket +import json +import os +import time +import subprocess +import random +import queue +import logging + +log = logging.getLogger('mpv-jsonipc') + +if os.name == "nt": + import _winapi + from multiprocessing.connection import PipeConnection + +TIMEOUT = 120 + +# Older MPV versions do not allow us to dynamically retrieve the command list. +FALLBACK_COMMAND_LIST = [ + 'ignore', 'seek', 'revert-seek', 'quit', 'quit-watch-later', 'stop', 'frame-step', 'frame-back-step', + 'playlist-next', 'playlist-prev', 'playlist-shuffle', 'playlist-unshuffle', 'sub-step', 'sub-seek', + 'print-text', 'show-text', 'expand-text', 'expand-path', 'show-progress', 'sub-add', 'audio-add', + 'video-add', 'sub-remove', 'audio-remove', 'video-remove', 'sub-reload', 'audio-reload', 'video-reload', + 'rescan-external-files', 'screenshot', 'screenshot-to-file', 'screenshot-raw', 'loadfile', 'loadlist', + 'playlist-clear', 'playlist-remove', 'playlist-move', 'run', 'subprocess', 'set', 'change-list', 'add', + 'cycle', 'multiply', 'cycle-values', 'enable-section', 'disable-section', 'define-section', 'ab-loop', + 'drop-buffers', 'af', 'vf', 'af-command', 'vf-command', 'ao-reload', 'script-binding', 'script-message', + 'script-message-to', 'overlay-add', 'overlay-remove', 'osd-overlay', 'write-watch-later-config', + 'hook-add', 'hook-ack', 'mouse', 'keybind', 'keypress', 'keydown', 'keyup', 'apply-profile', + 'load-script', 'dump-cache', 'ab-loop-dump-cache', 'ab-loop-align-cache'] + +class MPVError(Exception): + """An error originating from MPV or due to a problem with MPV.""" + def __init__(self, *args, **kwargs): + super(MPVError, self).__init__(*args, **kwargs) + +class WindowsSocket(threading.Thread): + """ + Wraps a Windows named pipe in a high-level interface. (Internal) + + Data is automatically encoded and decoded as JSON. The callback + function will be called for each inbound message. + """ + def __init__(self, ipc_socket, callback=None, quit_callback=None): + """Create the wrapper. + + *ipc_socket* is the pipe name. (Not including \\\\.\\pipe\\) + *callback(json_data)* is the function for recieving events. + *quit_callback* is called when the socket connection dies. + """ + ipc_socket = "\\\\.\\pipe\\" + ipc_socket + self.callback = callback + self.quit_callback = quit_callback + + access = _winapi.GENERIC_READ | _winapi.GENERIC_WRITE + limit = 5 # Connection may fail at first. Try 5 times. + for _ in range(limit): + try: + pipe_handle = _winapi.CreateFile( + ipc_socket, access, 0, _winapi.NULL, _winapi.OPEN_EXISTING, + _winapi.FILE_FLAG_OVERLAPPED, _winapi.NULL + ) + break + except OSError: + time.sleep(1) + else: + raise MPVError("Cannot connect to pipe.") + self.socket = PipeConnection(pipe_handle) + + if self.callback is None: + self.callback = lambda data: None + + threading.Thread.__init__(self) + + def stop(self, join=True): + """Terminate the thread.""" + if self.socket is not None: + self.socket.close() + if join: + self.join() + + def send(self, data): + """Send *data* to the pipe, encoded as JSON.""" + try: + self.socket.send_bytes(json.dumps(data).encode('utf-8') + b'\n') + except OSError as ex: + if len(ex.args) == 1 and ex.args[0] == "handle is closed": + raise BrokenPipeError("handle is closed") + raise ex + + def run(self): + """Process pipe events. Do not run this directly. Use *start*.""" + data = b'' + try: + while True: + current_data = self.socket.recv_bytes(2048) + if current_data == b'': + break + + data += current_data + if data[-1] != 10: + continue + + data = data.decode('utf-8', 'ignore').encode('utf-8') + for item in data.split(b'\n'): + if item == b'': + continue + json_data = json.loads(item) + self.callback(json_data) + data = b'' + except EOFError: + if self.quit_callback: + self.quit_callback() + +class UnixSocket(threading.Thread): + """ + Wraps a Unix/Linux socket in a high-level interface. (Internal) + + Data is automatically encoded and decoded as JSON. The callback + function will be called for each inbound message. + """ + def __init__(self, ipc_socket, callback=None, quit_callback=None): + """Create the wrapper. + + *ipc_socket* is the path to the socket. + *callback(json_data)* is the function for recieving events. + *quit_callback* is called when the socket connection dies. + """ + self.ipc_socket = ipc_socket + self.callback = callback + self.quit_callback = quit_callback + self.socket = socket.socket(socket.AF_UNIX) + self.socket.connect(self.ipc_socket) + + if self.callback is None: + self.callback = lambda data: None + + threading.Thread.__init__(self) + + def stop(self, join=True): + """Terminate the thread.""" + if self.socket is not None: + try: + self.socket.shutdown(socket.SHUT_WR) + self.socket.close() + self.socket = None + except OSError: + pass # Ignore socket close failure. + if join: + self.join() + + def send(self, data): + """Send *data* to the socket, encoded as JSON.""" + if self.socket is None: + raise BrokenPipeError("socket is closed") + self.socket.send(json.dumps(data).encode('utf-8') + b'\n') + + def run(self): + """Process socket events. Do not run this directly. Use *start*.""" + data = b'' + while True: + current_data = self.socket.recv(1024) + if current_data == b'': + break + + data += current_data + if data[-1] != 10: + continue + + data = data.decode('utf-8', 'ignore').encode('utf-8') + for item in data.split(b'\n'): + if item == b'': + continue + json_data = json.loads(item) + self.callback(json_data) + data = b'' + if self.quit_callback: + self.quit_callback() + +class MPVProcess: + """ + Manages an MPV process, ensuring the socket or pipe is available. (Internal) + """ + def __init__(self, ipc_socket, mpv_location=None, **kwargs): + """ + Create and start the MPV process. Will block until socket/pipe is available. + + *ipc_socket* is the path to the Unix/Linux socket or name of the Windows pipe. + *mpv_location* is the path to mpv. If left unset it tries the one in the PATH. + + All other arguments are forwarded to MPV as command-line arguments. + """ + if mpv_location is None: + if os.name == 'nt': + mpv_location = "mpv.exe" + else: + mpv_location = "mpv" + + log.debug("Staring MPV from {0}.".format(mpv_location)) + ipc_socket_name = ipc_socket + if os.name == 'nt': + ipc_socket = "\\\\.\\pipe\\" + ipc_socket + + if os.name != 'nt' and os.path.exists(ipc_socket): + os.remove(ipc_socket) + + log.debug("Using IPC socket {0} for MPV.".format(ipc_socket)) + self.ipc_socket = ipc_socket + args = [mpv_location] + self._set_default(kwargs, "idle", True) + self._set_default(kwargs, "input_ipc_server", ipc_socket_name) + self._set_default(kwargs, "input_terminal", False) + self._set_default(kwargs, "terminal", False) + args.extend("--{0}={1}".format(v[0].replace("_", "-"), self._mpv_fmt(v[1])) + for v in kwargs.items()) + self.process = subprocess.Popen(args) + ipc_exists = False + for _ in range(100): # Give MPV 10 seconds to start. + time.sleep(0.1) + self.process.poll() + if os.path.exists(ipc_socket): + ipc_exists = True + log.debug("Found MPV socket.") + break + if self.process.returncode is not None: + log.error("MPV failed with returncode {0}.".format(self.process.returncode)) + break + else: + self.process.terminate() + raise MPVError("MPV start timed out.") + + if not ipc_exists or self.process.returncode is not None: + self.process.terminate() + raise MPVError("MPV not started.") + + def _set_default(self, prop_dict, key, value): + if key not in prop_dict: + prop_dict[key] = value + + def _mpv_fmt(self, data): + if data == True: + return "yes" + elif data == False: + return "no" + else: + return data + + def stop(self): + """Terminate the process.""" + self.process.terminate() + if os.name != 'nt' and os.path.exists(self.ipc_socket): + os.remove(self.ipc_socket) + +class MPVInter: + """ + Low-level interface to MPV. Does NOT manage an mpv process. (Internal) + """ + def __init__(self, ipc_socket, callback=None, quit_callback=None): + """Create the wrapper. + + *ipc_socket* is the path to the Unix/Linux socket or name of the Windows pipe. + *callback(event_name, data)* is the function for recieving events. + *quit_callback* is called when the socket connection to MPV dies. + """ + Socket = UnixSocket + if os.name == 'nt': + Socket = WindowsSocket + + self.callback = callback + self.quit_callback = quit_callback + if self.callback is None: + self.callback = lambda event, data: None + + self.socket = Socket(ipc_socket, self.event_callback, self.quit_callback) + self.socket.start() + self.command_id = 1 + self.rid_lock = threading.Lock() + self.socket_lock = threading.Lock() + self.cid_result = {} + self.cid_wait = {} + + def stop(self, join=True): + """Terminate the underlying connection.""" + self.socket.stop(join) + + def event_callback(self, data): + """Internal callback for recieving events from MPV.""" + if "request_id" in data: + self.cid_result[data["request_id"]] = data + self.cid_wait[data["request_id"]].set() + elif "event" in data: + self.callback(data["event"], data) + + def command(self, command, *args): + """ + Issue a command to MPV. Will block until completed or timeout is reached. + + *command* is the name of the MPV command + + All further arguments are forwarded to the MPV command. + Throws TimeoutError if timeout of 120 seconds is reached. + """ + self.rid_lock.acquire() + command_id = self.command_id + self.command_id += 1 + self.rid_lock.release() + + event = threading.Event() + self.cid_wait[command_id] = event + + command_list = [command] + command_list.extend(args) + try: + self.socket_lock.acquire() + self.socket.send({"command":command_list, "request_id": command_id}) + finally: + self.socket_lock.release() + + has_event = event.wait(timeout=TIMEOUT) + if has_event: + data = self.cid_result[command_id] + del self.cid_result[command_id] + del self.cid_wait[command_id] + if data["error"] != "success": + if data["error"] == "property unavailable": + return None + raise MPVError(data["error"]) + else: + return data.get("data") + else: + raise TimeoutError("No response from MPV.") + +class EventHandler(threading.Thread): + """Event handling thread. (Internal)""" + def __init__(self): + """Create an instance of the thread.""" + self.queue = queue.Queue() + threading.Thread.__init__(self) + + def put_task(self, func, *args): + """ + Put a new task to the thread. + + *func* is the function to call + + All further arguments are forwarded to *func*. + """ + self.queue.put((func, args)) + + def stop(self, join=True): + """Terminate the thread.""" + self.queue.put("quit") + self.join(join) + + def run(self): + """Process socket events. Do not run this directly. Use *start*.""" + while True: + event = self.queue.get() + if event == "quit": + break + try: + event[0](*event[1]) + except Exception: + log.error("EventHandler caught exception from {0}.".format(event), exc_info=1) + +class MPV: + """ + The main MPV interface class. Use this to control MPV. + + This will expose all mpv commands as callable methods and all properties. + You can set properties and call the commands directly. + + Please note that if you are using a really old MPV version, a fallback command + list is used. Not all commands may actually work when this fallback is used. + """ + def __init__(self, start_mpv=True, ipc_socket=None, mpv_location=None, + log_handler=None, loglevel=None, quit_callback=None, **kwargs): + """ + Create the interface to MPV and process instance. + + *start_mpv* will start an MPV process if true. (Default: True) + *ipc_socket* is the path to the Unix/Linux socket or name of Windows pipe. (Default: Random Temp File) + *mpv_location* is the location of MPV for *start_mpv*. (Default: Use MPV in PATH) + *log_handler(level, prefix, text)* is an optional handler for log events. (Default: Disabled) + *loglevel* is the level for log messages. Levels are fatal, error, warn, info, v, debug, trace. (Default: Disabled) + *quit_callback* is called when the socket connection to MPV dies. + + All other arguments are forwarded to MPV as command-line arguments if *start_mpv* is used. + """ + self.properties = {} + self.event_bindings = {} + self.key_bindings = {} + self.property_bindings = {} + self.mpv_process = None + self.mpv_inter = None + self.quit_callback = quit_callback + self.event_handler = EventHandler() + self.event_handler.start() + if ipc_socket is None: + rand_file = "mpv{0}".format(random.randint(0, 2**48)) + if os.name == "nt": + ipc_socket = rand_file + else: + ipc_socket = "/tmp/{0}".format(rand_file) + + if start_mpv: + # Attempt to start MPV 3 times. + for i in range(3): + try: + self.mpv_process = MPVProcess(ipc_socket, mpv_location, **kwargs) + break + except MPVError: + log.warning("MPV start failed.", exc_info=1) + continue + else: + raise MPVError("MPV process retry limit reached.") + + self.mpv_inter = MPVInter(ipc_socket, self._callback, self._quit_callback) + self.properties = set(x.replace("-", "_") for x in self.command("get_property", "property-list")) + try: + command_list = [x["name"] for x in self.command("get_property", "command-list")] + except MPVError: + log.warning("Using fallback command list.") + command_list = FALLBACK_COMMAND_LIST + for command in command_list: + object.__setattr__(self, command.replace("-", "_"), self._get_wrapper(command)) + + self._dir = list(self.properties) + self._dir.extend(object.__dir__(self)) + + self.observer_id = 1 + self.observer_lock = threading.Lock() + self.keybind_id = 1 + self.keybind_lock = threading.Lock() + + if log_handler is not None and loglevel is not None: + self.command("request_log_messages", loglevel) + @self.on_event("log-message") + def log_handler_event(data): + self.event_handler.put_task(log_handler, data["level"], data["prefix"], data["text"].strip()) + + @self.on_event("property-change") + def event_handler(data): + if data.get("id") in self.property_bindings: + self.event_handler.put_task(self.property_bindings[data["id"]], data["name"], data.get("data")) + + @self.on_event("client-message") + def client_message_handler(data): + args = data["args"] + if len(args) == 2 and args[0] == "custom-bind": + self.event_handler.put_task(self.key_bindings[args[1]]) + + def _quit_callback(self): + """ + Internal handler for quit events. + """ + if self.quit_callback: + self.quit_callback() + self.terminate(join=False) + + def bind_event(self, name, callback): + """ + Bind a callback to an MPV event. + + *name* is the MPV event name. + *callback(event_data)* is the function to call. + """ + if name not in self.event_bindings: + self.event_bindings[name] = set() + self.event_bindings[name].add(callback) + + def on_event(self, name): + """ + Decorator to bind a callback to an MPV event. + + @on_event(name) + def my_callback(event_data): + pass + """ + def wrapper(func): + self.bind_event(name, func) + return func + return wrapper + + # Added for compatibility. + def event_callback(self, name): + """An alias for on_event to maintain compatibility with python-mpv.""" + return self.on_event(name) + + def on_key_press(self, name): + """ + Decorator to bind a callback to an MPV keypress event. + + @on_key_press(key_name) + def my_callback(): + pass + """ + def wrapper(func): + self.bind_key_press(name, func) + return func + return wrapper + + def bind_key_press(self, name, callback): + """ + Bind a callback to an MPV keypress event. + + *name* is the key symbol. + *callback()* is the function to call. + """ + self.keybind_lock.acquire() + keybind_id = self.keybind_id + self.keybind_id += 1 + self.keybind_lock.release() + + bind_name = "bind{0}".format(keybind_id) + self.key_bindings["bind{0}".format(keybind_id)] = callback + try: + self.keybind(name, "script-message custom-bind {0}".format(bind_name)) + except MPVError: + self.define_section(bind_name, "{0} script-message custom-bind {1}".format(name, bind_name)) + self.enable_section(bind_name) + + def bind_property_observer(self, name, callback): + """ + Bind a callback to an MPV property change. + + *name* is the property name. + *callback(name, data)* is the function to call. + + Returns a unique observer ID needed to destroy the observer. + """ + self.observer_lock.acquire() + observer_id = self.observer_id + self.observer_id += 1 + self.observer_lock.release() + + self.property_bindings[observer_id] = callback + self.command("observe_property", observer_id, name) + return observer_id + + def unbind_property_observer(self, observer_id): + """ + Remove callback to an MPV property change. + + *observer_id* is the id returned by bind_property_observer. + """ + self.command("unobserve_property", observer_id) + del self.property_bindings[observer_id] + + def property_observer(self, name): + """ + Decorator to bind a callback to an MPV property change. + + @property_observer(property_name) + def my_callback(name, data): + pass + """ + def wrapper(func): + self.bind_property_observer(name, func) + return func + return wrapper + + def wait_for_property(self, name): + """ + Waits for the value of a property to change. + + *name* is the name of the property. + """ + event = threading.Event() + first_event = True + def handler(*_): + nonlocal first_event + if first_event == True: + first_event = False + else: + event.set() + observer_id = self.bind_property_observer(name, handler) + event.wait() + self.unbind_property_observer(observer_id) + + def _get_wrapper(self, name): + def wrapper(*args): + return self.command(name, *args) + return wrapper + + def _callback(self, event, data): + if event in self.event_bindings: + for callback in self.event_bindings[event]: + self.event_handler.put_task(callback, data) + + def play(self, url): + """Play the specified URL. An alias to loadfile().""" + self.loadfile(url) + + def __del__(self): + self.terminate() + + def terminate(self, join=True): + """Terminate the connection to MPV and process (if *start_mpv* is used).""" + if self.mpv_process: + self.mpv_process.stop() + if self.mpv_inter: + self.mpv_inter.stop(join) + self.event_handler.stop(join) + + def command(self, command, *args): + """ + Send a command to MPV. All commands are bound to the class by default, + except JSON IPC specific commands. This may also be useful to retain + compatibility with python-mpv, as it does not bind all of the commands. + + *command* is the command name. + + All further arguments are forwarded to the MPV command. + """ + return self.mpv_inter.command(command, *args) + + def __getattr__(self, name): + if name in self.properties: + return self.command("get_property", name.replace("_", "-")) + return object.__getattribute__(self, name) + + def __setattr__(self, name, value): + if name not in {"properties", "command"} and name in self.properties: + return self.command("set_property", name.replace("_", "-"), value) + return object.__setattr__(self, name, value) + + def __hasattr__(self, name): + if object.__hasattr__(self, name): + return True + else: + try: + getattr(self, name) + return True + except MPVError: + return False + + def __dir__(self): + return self._dir diff --git a/syncplay/players/python_mpv_jsonipc/setup.py b/syncplay/players/python_mpv_jsonipc/setup.py new file mode 100644 index 0000000..50e14f5 --- /dev/null +++ b/syncplay/players/python_mpv_jsonipc/setup.py @@ -0,0 +1,25 @@ +from setuptools import setup +import os + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup( + name='python-mpv-jsonipc', + version='1.1.11', + author="Ian Walton", + author_email="iwalton3@gmail.com", + description="Python API to MPV using JSON IPC", + license='Apache-2.0', + long_description=open('README.md').read(), + long_description_content_type="text/markdown", + url="https://github.com/iwalton3/python-mpv-jsonipc", + py_modules=['python_mpv_jsonipc'], + classifiers=[ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + ], + python_requires='>=3.6', + install_requires=[] +) diff --git a/syncplay/resources/syncplayintf.lua b/syncplay/resources/syncplayintf.lua index 839f4e4..09add0a 100644 --- a/syncplay/resources/syncplayintf.lua +++ b/syncplay/resources/syncplayintf.lua @@ -341,6 +341,18 @@ mp.register_script_message('set_syncplayintf_options', function(e) set_syncplayintf_options(e) end) +function state_paused_and_position() + -- bob + local pause_status = tostring(mp.get_property_native("pause")) + local position_status = tostring(mp.get_property_native("time-pos")) + mp.command('print-text ""') + -- mp.command('print-text "true7.6"') +end + +mp.register_script_message('get_paused_and_position', function() + state_paused_and_position() +end) + -- Default options local utils = require 'mp.utils' local options = require 'mp.options' diff --git a/syncplay/resources/third-party-notices.rtf b/syncplay/resources/third-party-notices.rtf index bd2c722..8aebd9b 100644 --- a/syncplay/resources/third-party-notices.rtf +++ b/syncplay/resources/third-party-notices.rtf @@ -1,489 +1,463 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf600 -{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -{\*\expandedcolortbl;;} -\vieww13920\viewh8980\viewkind0 -\deftab529 -\pard\tx529\pardeftab529\pardirnatural\partightenfactor0 - -\f0\fs24 \cf0 \CocoaLigature0 Syncplay relies on the following softwares, in compliance with their licenses. \ -\ - -\b Qt.py -\b0 \ -\ -Copyright (c) 2016 Marcus Ottosson\ -\ -Permission is hereby granted, free of charge, to any person obtaining a copy\ -of this software and associated documentation files (the "Software"), to deal\ -in the Software without restriction, including without limitation the rights\ -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ -copies of the Software, and to permit persons to whom the Software is\ -furnished to do so, subject to the following conditions:\ -\ -The above copyright notice and this permission notice shall be included in all\ -copies or substantial portions of the Software.\ -\ - -\b Qt for Python\ - -\b0 \ -Copyright (C) 2018 The Qt Company Ltd.\ -Contact: https://www.qt.io/licensing/\ -\ -This program is free software: you can redistribute it and/or modify\ -it under the terms of the GNU Lesser General Public License as published\ -by the Free Software Foundation, either version 3 of the License, or\ -(at your option) any later version.\ -\ -This program is distributed in the hope that it will be useful,\ -but WITHOUT ANY WARRANTY; without even the implied warranty of\ -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\ -GNU Lesser General Public License for more details.\ -\ -You should have received a copy of the GNU Lesser General Public License\ -along with this program. If not, see .\ -\ - -\b Qt -\b0 \ -\ -This program uses Qt under the GNU LGPL version 3.\ -\ -Qt is a C++ toolkit for cross-platform application development.\ -\ -Qt provides single-source portability across all major desktop operating systems. It is also available for embedded Linux and other embedded and mobile operating systems.\ -\ -Qt is available under three different licensing options designed to accommodate the needs of our various users.\ -\ -Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 3 or GNU LGPL version 2.1.\ -\ -Qt licensed under the GNU LGPL version 3 is appropriate for the development of Qt applications provided you can comply with the terms and conditions of the GNU LGPL version 3.\ -\ -Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications provided you can comply with the terms and conditions of the GNU LGPL version 2.1.\ -\ -Please see qt.io/licensing for an overview of Qt licensing.\ -\ -Copyright (C) 2017 The Qt Company Ltd and other contributors.\ -\ -Qt and the Qt logo are trademarks of The Qt Company Ltd.\ -\ -Qt is The Qt Company Ltd product developed as an open source project. See qt.io for more information.\ -\ - -\b Twisted\ -\ - -\b0 Copyright (c) 2001-2017\ -Allen Short\ -Amber Hawkie Brown\ -Andrew Bennetts\ -Andy Gayton\ -Antoine Pitrou\ -Apple Computer, Inc.\ -Ashwini Oruganti\ -Benjamin Bruheim\ -Bob Ippolito\ -Canonical Limited\ -Christopher Armstrong\ -David Reid\ -Divmod Inc.\ -Donovan Preston\ -Eric Mangold\ -Eyal Lotem\ -Google Inc.\ -Hybrid Logic Ltd.\ -Hynek Schlawack\ -Itamar Turner-Trauring\ -James Knight\ -Jason A. Mobarak\ -Jean-Paul Calderone\ -Jessica McKellar\ -Jonathan D. Simms\ -Jonathan Jacobs\ -Jonathan Lange\ -Julian Berman\ -J\'fcrgen Hermann\ -Kevin Horn\ -Kevin Turner\ -Laurens Van Houtven\ -Mary Gardiner\ -Massachusetts Institute of Technology\ -Matthew Lefkowitz\ -Moshe Zadka\ -Paul Swartz\ -Pavel Pergamenshchik\ -Rackspace, US Inc.\ -Ralph Meijer\ -Richard Wall\ -Sean Riley\ -Software Freedom Conservancy\ -Tavendo GmbH\ -Thijs Triemstra\ -Thomas Herve\ -Timothy Allen\ -Tom Prince\ -Travis B. Hartwell\ -\ -and others that have contributed code to the public domain.\ -\ -Permission is hereby granted, free of charge, to any person obtaining\ -a copy of this software and associated documentation files (the\ -"Software"), to deal in the Software without restriction, including\ -without limitation the rights to use, copy, modify, merge, publish,\ -distribute, sublicense, and/or sell copies of the Software, and to\ -permit persons to whom the Software is furnished to do so, subject to\ -the following conditions:\ -\ -The above copyright notice and this permission notice shall be\ -included in all copies or substantial portions of the Software.\ - -\b \ -qt5reactor\ -\ - -\b0 Copyright (c) 2001-2018\ -Allen Short\ -Andy Gayton\ -Andrew Bennetts\ -Antoine Pitrou\ -Apple Computer, Inc.\ -Ashwini Oruganti\ -bakbuk\ -Benjamin Bruheim\ -Bob Ippolito\ -Burak Nehbit\ -Canonical Limited\ -Christopher Armstrong\ -Christopher R. Wood\ -David Reid\ -Donovan Preston\ -Elvis Stansvik\ -Eric Mangold\ -Eyal Lotem\ -Glenn Tarbox\ -Google Inc.\ -Hybrid Logic Ltd.\ -Hynek Schlawack\ -Itamar Turner-Trauring\ -James Knight\ -Jason A. Mobarak\ -Jean-Paul Calderone\ -Jessica McKellar\ -Jonathan Jacobs\ -Jonathan Lange\ -Jonathan D. Simms\ -J\'fcrgen Hermann\ -Julian Berman\ -Kevin Horn\ -Kevin Turner\ -Kyle Altendorf\ -Laurens Van Houtven\ -Mary Gardiner\ -Matthew Lefkowitz\ -Massachusetts Institute of Technology\ -Moshe Zadka\ -Paul Swartz\ -Pavel Pergamenshchik\ -Ralph Meijer\ -Richard Wall\ -Sean Riley\ -Software Freedom Conservancy\ -Tarashish Mishra\ -Travis B. Hartwell\ -Thijs Triemstra\ -Thomas Herve\ -Timothy Allen\ -Tom Prince\ -\ -Permission is hereby granted, free of charge, to any person obtaining\ -a copy of this software and associated documentation files (the\ -"Software"), to deal in the Software without restriction, including\ -without limitation the rights to use, copy, modify, merge, publish,\ -distribute, sublicense, and/or sell copies of the Software, and to\ -permit persons to whom the Software is furnished to do so, subject to\ -the following conditions:\ -\ -The above copyright notice and this permission notice shall be\ -included in all copies or substantial portions of the Software.\ -\ -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\ -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\ -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\ -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\ -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\ -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\ -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -\b \ -\ -appnope\ - -\b0 \ -Copyright (c) 2013, Min Ragan-Kelley\ -\ -All rights reserved.\ -\ -Redistribution and use in source and binary forms, with or without\ -modification, are permitted provided that the following conditions are met:\ -\ -Redistributions of source code must retain the above copyright notice, this\ -list of conditions and the following disclaimer.\ -\ -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\ -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\ -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\ -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\ -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\ -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\ -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\ -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\ -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\ -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\ -\ - -\b py2exe\ - -\b0 \ -Copyright (c) 2000-2013 Thomas Heller, Jimmy Retzlaff\ -\ -Permission is hereby granted, free of charge, to any person obtaining\ -a copy of this software and associated documentation files (the\ -"Software"), to deal in the Software without restriction, including\ -without limitation the rights to use, copy, modify, merge, publish,\ -distribute, sublicense, and/or sell copies of the Software, and to\ -permit persons to whom the Software is furnished to do so, subject to\ -the following conditions:\ -\ -The above copyright notice and this permission notice shall be\ -included in all copies or substantial portions of the Software.\ -\ - -\b py2app\ -\ - -\b0 Copyright (c) 2004 Bob Ippolito.\ -\ -Some parts copyright (c) 2010-2014 Ronald Oussoren\ -\ -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\ -\ -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\ -\ - -\b dmgbuild\ -\ - -\b0 Copyright (c) 2014 Alastair Houghton\ -Copyright (c) 2017 The Qt Company Ltd.\ -\ -Permission is hereby granted, free of charge, to any person obtaining a copy\ -of this software and associated documentation files (the "Software"), to deal\ -in the Software without restriction, including without limitation the rights\ -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ -copies of the Software, and to permit persons to whom the Software is\ -furnished to do so, subject to the following conditions:\ -\ -The above copyright notice and this permission notice shall be included in\ -all copies or substantial portions of the Software.\ -\ - -\b Requests\ -\ - -\b0 Copyright 2018 Kenneth Reitz\ -\ -Licensed under the Apache License, Version 2.0 (the \'93License\'94); you may not use this file\ -except in compliance with the License. You may obtain a copy of the License at\ -\ -http://www.apache.org/licenses/LICENSE-2.0\ -\ -Unless required by applicable law or agreed to in writing, software distributed under the \ -License is distributed on an \'93AS IS\'94 BASIS, WITHOUT WARRANTIES OR CONDI-\ -TIONS OF ANY KIND, either express or implied. See the License for the specific lang-\ -uage governing permissions and limitations under the License.\ -\ - -\b mpv-repl -\b0 \ -\ -Copyright 2016, James Ross-Gowan\ -\ -Permission to use, copy, modify, and/or distribute this software for any\ -purpose with or without fee is hereby granted, provided that the above\ -copyright notice and this permission notice appear in all copies.\ -\ -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\ -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\ -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\ -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\ -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\ -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\ -PERFORMANCE OF THIS SOFTWARE.\ -\ - -\b python-certifi -\b0 \ -\ -This Source Code Form is subject to the terms of the Mozilla Public License,\ -v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain\ -one at http://mozilla.org/MPL/2.0/.\ -\ - -\b cffi -\b0 \ -\ -\pard\pardeftab720\partightenfactor0 -\cf0 This package has been mostly done by Armin Rigo with help from\ -Maciej Fija\uc0\u322 kowski. The idea is heavily based (although not directly\ -copied) from LuaJIT ffi by Mike Pall.\ -\ -Other contributors:\ -\ - Google Inc.\ -\pard\tx529\pardeftab529\pardirnatural\partightenfactor0 -\cf0 \ -The MIT License\ -\ -Permission is hereby granted, free of charge, to any person \ -obtaining a copy of this software and associated documentation \ -files (the "Software"), to deal in the Software without \ -restriction, including without limitation the rights to use, \ -copy, modify, merge, publish, distribute, sublicense, and/or \ -sell copies of the Software, and to permit persons to whom the \ -Software is furnished to do so, subject to the following conditions:\ -\ -The above copyright notice and this permission notice shall be included \ -in all copies or substantial portions of the Software.\ -\ -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS \ -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \ -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL \ -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \ -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \ -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER \ -DEALINGS IN THE SOFTWARE.\ -\ - -\b service-identity -\b0 \ -\ -Copyright (c) 2014 Hynek Schlawack\ -\ -Permission is hereby granted, free of charge, to any person obtaining a copy of\ -this software and associated documentation files (the "Software"), to deal in\ -the Software without restriction, including without limitation the rights to\ -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\ -of the Software, and to permit persons to whom the Software is furnished to do\ -so, subject to the following conditions:\ -\ -The above copyright notice and this permission notice shall be included in all\ -copies or substantial portions of the Software.\ -\ -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\ -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\ -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\ -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\ -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\ -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\ -SOFTWARE.\ -\ - -\b pyopenssl -\b0 \ -\ -Licensed under the Apache License, Version 2.0 (the \'93License\'94); you may not use this file\ -except in compliance with the License. You may obtain a copy of the License at\ -\ -http://www.apache.org/licenses/LICENSE-2.0\ -\ -Unless required by applicable law or agreed to in writing, software distributed under the \ -License is distributed on an \'93AS IS\'94 BASIS, WITHOUT WARRANTIES OR CONDI-\ -TIONS OF ANY KIND, either express or implied. See the License for the specific lang-\ -uage governing permissions and limitations under the License.\ -\ - -\b cryptography -\b0 \ -\ -Authors listed here: https://github.com/pyca/cryptography/blob/master/AUTHORS.rst\ -\ -Licensed under the Apache License, Version 2.0 (the \'93License\'94); you may not use this file\ -except in compliance with the License. You may obtain a copy of the License at\ -\ -http://www.apache.org/licenses/LICENSE-2.0\ -\ -Unless required by applicable law or agreed to in writing, software distributed under the \ -License is distributed on an \'93AS IS\'94 BASIS, WITHOUT WARRANTIES OR CONDI-\ -TIONS OF ANY KIND, either express or implied. See the License for the specific lang-\ -uage governing permissions and limitations under the License.\ -\ - -\b Darkdetect -\b0 \ -\ -Copyright (c) 2019, Alberto Sottile\ -All rights reserved.\ -\ -Redistribution and use in source and binary forms, with or without\ -modification, are permitted provided that the following conditions are met:\ - * Redistributions of source code must retain the above copyright\ - notice, this list of conditions and the following disclaimer.\ - * Redistributions in binary form must reproduce the above copyright\ - notice, this list of conditions and the following disclaimer in the\ - documentation and/or other materials provided with the distribution.\ - * Neither the name of "darkdetect" nor the\ - names of its contributors may be used to endorse or promote products\ - derived from this software without specific prior written permission.\ -\ -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\ -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\ -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\ -DISCLAIMED. IN NO EVENT SHALL "Alberto Sottile" BE LIABLE FOR ANY\ -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\ -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\ -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\ -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\ -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\ -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\ -\ - -\b Icons\ -\ - -\b0 Syncplay uses the following icons and images:\ -\ -- Silk icon set 1.3\ -_________________________________________\ -Mark James\ -http://www.famfamfam.com/lab/icons/silk/\ -_________________________________________\ -\ -This work is licensed under a\ -Creative Commons Attribution 2.5 License.\ -[ http://creativecommons.org/licenses/by/2.5/ ]\ -\ -This means you may use it for any purpose,\ -and make any changes you like.\ -All I ask is that you include a link back\ -to this page in your credits.\ -\ -Are you using this icon set? Send me an email\ -(including a link or picture if available) to\ -mjames@gmail.com\ -\ -Any other questions about this icon set please\ -contact mjames@gmail.com\ -\ -- Silk Companion 1\ -\ -\pard\pardeftab720\partightenfactor0 -\cf0 Copyright Damien Guard - CC-BY 3.0\ -https://damieng.com/creative/icons/silk-companion-1-icons\ -\ -- Padlock free icon\ -CC-BY 3.0\ -Icon made by Maxim Basinski from https://www.flaticon.com/free-icon/padlock_291248\ -\ -\pard\tx529\pardeftab529\pardirnatural\partightenfactor0 -\cf0 \ -} \ No newline at end of file +{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deftab529{\fonttbl{\f0\fswiss\fcharset0 Helvetica;}{\f1\fswiss\fcharset238 Helvetica;}} +{\colortbl ;\red0\green0\blue255;} +{\*\generator Riched20 10.0.18362}\viewkind4\uc1 +\pard\tx529\f0\fs24\lang9 Syncplay relies on the following softwares, in compliance with their licenses. \par +\par +\b Qt.py\b0\par +\par +Copyright (c) 2016 Marcus Ottosson\par +\par +Permission is hereby granted, free of charge, to any person obtaining a copy\par +of this software and associated documentation files (the "Software"), to deal\par +in the Software without restriction, including without limitation the rights\par +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\par +copies of the Software, and to permit persons to whom the Software is\par +furnished to do so, subject to the following conditions:\par +\par +The above copyright notice and this permission notice shall be included in all\par +copies or substantial portions of the Software.\par +\par +\b Qt for Python\par +\b0\par +Copyright (C) 2018 The Qt Company Ltd.\par +Contact: {{\field{\*\fldinst{HYPERLINK https://www.qt.io/licensing/ }}{\fldrslt{https://www.qt.io/licensing/\ul0\cf0}}}}\f0\fs24\par +\par +This program is free software: you can redistribute it and/or modify\par +it under the terms of the GNU Lesser General Public License as published\par +by the Free Software Foundation, either version 3 of the License, or\par +(at your option) any later version.\par +\par +This program is distributed in the hope that it will be useful,\par +but WITHOUT ANY WARRANTY; without even the implied warranty of\par +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\par +GNU Lesser General Public License for more details.\par +\par +You should have received a copy of the GNU Lesser General Public License\par +along with this program. If not, see <{{\field{\*\fldinst{HYPERLINK "http://www.gnu.org/licenses/"}}{\fldrslt{http://www.gnu.org/licenses/\ul0\cf0}}}}\f0\fs24 >.\par +\par +\b Qt\b0\par +\par +This program uses Qt under the GNU LGPL version 3.\par +\par +Qt is a C++ toolkit for cross-platform application development.\par +\par +Qt provides single-source portability across all major desktop operating systems. It is also available for embedded Linux and other embedded and mobile operating systems.\par +\par +Qt is available under three different licensing options designed to accommodate the needs of our various users.\par +\par +Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 3 or GNU LGPL version 2.1.\par +\par +Qt licensed under the GNU LGPL version 3 is appropriate for the development of Qt applications provided you can comply with the terms and conditions of the GNU LGPL version 3.\par +\par +Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications provided you can comply with the terms and conditions of the GNU LGPL version 2.1.\par +\par +Please see qt.io/licensing for an overview of Qt licensing.\par +\par +Copyright (C) 2017 The Qt Company Ltd and other contributors.\par +\par +Qt and the Qt logo are trademarks of The Qt Company Ltd.\par +\par +Qt is The Qt Company Ltd product developed as an open source project. See qt.io for more information.\par +\par +\b Twisted\par +\par +\b0 Copyright (c) 2001-2017\par +Allen Short\par +Amber Hawkie Brown\par +Andrew Bennetts\par +Andy Gayton\par +Antoine Pitrou\par +Apple Computer, Inc.\par +Ashwini Oruganti\par +Benjamin Bruheim\par +Bob Ippolito\par +Canonical Limited\par +Christopher Armstrong\par +David Reid\par +Divmod Inc.\par +Donovan Preston\par +Eric Mangold\par +Eyal Lotem\par +Google Inc.\par +Hybrid Logic Ltd.\par +Hynek Schlawack\par +Itamar Turner-Trauring\par +James Knight\par +Jason A. Mobarak\par +Jean-Paul Calderone\par +Jessica McKellar\par +Jonathan D. Simms\par +Jonathan Jacobs\par +Jonathan Lange\par +Julian Berman\par +J\'fcrgen Hermann\par +Kevin Horn\par +Kevin Turner\par +Laurens Van Houtven\par +Mary Gardiner\par +Massachusetts Institute of Technology\par +Matthew Lefkowitz\par +Moshe Zadka\par +Paul Swartz\par +Pavel Pergamenshchik\par +Rackspace, US Inc.\par +Ralph Meijer\par +Richard Wall\par +Sean Riley\par +Software Freedom Conservancy\par +Tavendo GmbH\par +Thijs Triemstra\par +Thomas Herve\par +Timothy Allen\par +Tom Prince\par +Travis B. Hartwell\par +\par +and others that have contributed code to the public domain.\par +\par +Permission is hereby granted, free of charge, to any person obtaining\par +a copy of this software and associated documentation files (the\par +"Software"), to deal in the Software without restriction, including\par +without limitation the rights to use, copy, modify, merge, publish,\par +distribute, sublicense, and/or sell copies of the Software, and to\par +permit persons to whom the Software is furnished to do so, subject to\par +the following conditions:\par +\par +The above copyright notice and this permission notice shall be\par +included in all copies or substantial portions of the Software.\par +\b\par +qt5reactor\par +\par +\b0 Copyright (c) 2001-2018\par +Allen Short\par +Andy Gayton\par +Andrew Bennetts\par +Antoine Pitrou\par +Apple Computer, Inc.\par +Ashwini Oruganti\par +bakbuk\par +Benjamin Bruheim\par +Bob Ippolito\par +Burak Nehbit\par +Canonical Limited\par +Christopher Armstrong\par +Christopher R. Wood\par +David Reid\par +Donovan Preston\par +Elvis Stansvik\par +Eric Mangold\par +Eyal Lotem\par +Glenn Tarbox\par +Google Inc.\par +Hybrid Logic Ltd.\par +Hynek Schlawack\par +Itamar Turner-Trauring\par +James Knight\par +Jason A. Mobarak\par +Jean-Paul Calderone\par +Jessica McKellar\par +Jonathan Jacobs\par +Jonathan Lange\par +Jonathan D. Simms\par +J\'fcrgen Hermann\par +Julian Berman\par +Kevin Horn\par +Kevin Turner\par +Kyle Altendorf\par +Laurens Van Houtven\par +Mary Gardiner\par +Matthew Lefkowitz\par +Massachusetts Institute of Technology\par +Moshe Zadka\par +Paul Swartz\par +Pavel Pergamenshchik\par +Ralph Meijer\par +Richard Wall\par +Sean Riley\par +Software Freedom Conservancy\par +Tarashish Mishra\par +Travis B. Hartwell\par +Thijs Triemstra\par +Thomas Herve\par +Timothy Allen\par +Tom Prince\par +\par +Permission is hereby granted, free of charge, to any person obtaining\par +a copy of this software and associated documentation files (the\par +"Software"), to deal in the Software without restriction, including\par +without limitation the rights to use, copy, modify, merge, publish,\par +distribute, sublicense, and/or sell copies of the Software, and to\par +permit persons to whom the Software is furnished to do so, subject to\par +the following conditions:\par +\par +The above copyright notice and this permission notice shall be\par +included in all copies or substantial portions of the Software.\par +\par +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\par +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\par +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\par +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\par +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\par +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\par +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\b\par +\par +appnope\par +\b0\par +Copyright (c) 2013, Min Ragan-Kelley\par +\par +All rights reserved.\par +\par +Redistribution and use in source and binary forms, with or without\par +modification, are permitted provided that the following conditions are met:\par +\par +Redistributions of source code must retain the above copyright notice, this\par +list of conditions and the following disclaimer.\par +\par +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\par +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\par +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\par +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\par +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\par +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\par +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\par +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\par +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\par +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\par +\par +\b py2exe\par +\b0\par +Copyright (c) 2000-2013 Thomas Heller, Jimmy Retzlaff\par +\par +Permission is hereby granted, free of charge, to any person obtaining\par +a copy of this software and associated documentation files (the\par +"Software"), to deal in the Software without restriction, including\par +without limitation the rights to use, copy, modify, merge, publish,\par +distribute, sublicense, and/or sell copies of the Software, and to\par +permit persons to whom the Software is furnished to do so, subject to\par +the following conditions:\par +\par +The above copyright notice and this permission notice shall be\par +included in all copies or substantial portions of the Software.\par +\par +\b py2app\par +\par +\b0 Copyright (c) 2004 Bob Ippolito.\par +\par +Some parts copyright (c) 2010-2014 Ronald Oussoren\par +\par +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\par +\par +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\par +\par +\b dmgbuild\par +\par +\b0 Copyright (c) 2014 Alastair Houghton\par +Copyright (c) 2017 The Qt Company Ltd.\par +\par +Permission is hereby granted, free of charge, to any person obtaining a copy\par +of this software and associated documentation files (the "Software"), to deal\par +in the Software without restriction, including without limitation the rights\par +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\par +copies of the Software, and to permit persons to whom the Software is\par +furnished to do so, subject to the following conditions:\par +\par +The above copyright notice and this permission notice shall be included in\par +all copies or substantial portions of the Software.\par +\par +\b Requests\par +\par +\b0 Copyright 2018 Kenneth Reitz\par +\par +Licensed under the Apache License, Version 2.0 (the \ldblquote License\rdblquote ); you may not use this file\par +except in compliance with the License. You may obtain a copy of the License at\par +\par +{{\field{\*\fldinst{HYPERLINK http://www.apache.org/licenses/LICENSE-2.0 }}{\fldrslt{http://www.apache.org/licenses/LICENSE-2.0\ul0\cf0}}}}\f0\fs24\par +\par +Unless required by applicable law or agreed to in writing, software distributed under the \par +License is distributed on an \ldblquote AS IS\rdblquote BASIS, WITHOUT WARRANTIES OR CONDI-\par +TIONS OF ANY KIND, either express or implied. See the License for the specific lang-\par +uage governing permissions and limitations under the License.\par +\par +\b mpv-repl\b0\par +\par +Copyright 2016, James Ross-Gowan\par +\par +Permission to use, copy, modify, and/or distribute this software for any\par +purpose with or without fee is hereby granted, provided that the above\par +copyright notice and this permission notice appear in all copies.\par +\par +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\par +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\par +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\par +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\par +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\par +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\par +PERFORMANCE OF THIS SOFTWARE.\par +\par +\b python-certifi\b0\par +\par +This Source Code Form is subject to the terms of the Mozilla Public License,\par +v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain\par +one at {{\field{\*\fldinst{HYPERLINK http://mozilla.org/MPL/2.0/ }}{\fldrslt{http://mozilla.org/MPL/2.0/\ul0\cf0}}}}\f0\fs24 .\par +\par +\b cffi\b0\par +\par + +\pard This package has been mostly done by Armin Rigo with help from\par +Maciej Fija\f1\'b3kowski. The idea is heavily based (although not directly\par +copied) from LuaJIT ffi by Mike Pall.\par +\par +Other contributors:\par +\par + Google Inc.\par + +\pard\tx529\par +The MIT License\par +\par +Permission is hereby granted, free of charge, to any person \par +obtaining a copy of this software and associated documentation \par +files (the "Software"), to deal in the Software without \par +restriction, including without limitation the rights to use, \par +copy, modify, merge, publish, distribute, sublicense, and/or \par +sell copies of the Software, and to permit persons to whom the \par +Software is furnished to do so, subject to the following conditions:\par +\par +The above copyright notice and this permission notice shall be included \par +in all copies or substantial portions of the Software.\par +\par +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS \par +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \par +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL \par +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \par +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \par +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER \par +DEALINGS IN THE SOFTWARE.\par +\par +\b service-identity\b0\par +\par +Copyright (c) 2014 Hynek Schlawack\par +\par +Permission is hereby granted, free of charge, to any person obtaining a copy of\par +this software and associated documentation files (the "Software"), to deal in\par +the Software without restriction, including without limitation the rights to\par +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\par +of the Software, and to permit persons to whom the Software is furnished to do\par +so, subject to the following conditions:\par +\par +The above copyright notice and this permission notice shall be included in all\par +copies or substantial portions of the Software.\par +\par +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\par +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\par +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\par +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\par +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\par +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\par +SOFTWARE.\par +\par +\b pyopenssl\b0\par +\par +Licensed under the Apache License, Version 2.0 (the \ldblquote License\rdblquote ); you may not use this file\par +except in compliance with the License. You may obtain a copy of the License at\par +\par +{{\field{\*\fldinst{HYPERLINK http://www.apache.org/licenses/LICENSE-2.0 }}{\fldrslt{http://www.apache.org/licenses/LICENSE-2.0\ul0\cf0}}}}\f1\fs24\par +\par +Unless required by applicable law or agreed to in writing, software distributed under the \par +License is distributed on an \ldblquote AS IS\rdblquote BASIS, WITHOUT WARRANTIES OR CONDI-\par +TIONS OF ANY KIND, either express or implied. See the License for the specific lang-\par +uage governing permissions and limitations under the License.\par +\par +\b cryptography\b0\par +\par +Authors listed here: {{\field{\*\fldinst{HYPERLINK https://github.com/pyca/cryptography/blob/master/AUTHORS.rst }}{\fldrslt{https://github.com/pyca/cryptography/blob/master/AUTHORS.rst\ul0\cf0}}}}\f1\fs24\par +\par +Licensed under the Apache License, Version 2.0 (the \ldblquote License\rdblquote ); you may not use this file\par +except in compliance with the License. You may obtain a copy of the License at\par +\par +{{\field{\*\fldinst{HYPERLINK http://www.apache.org/licenses/LICENSE-2.0 }}{\fldrslt{http://www.apache.org/licenses/LICENSE-2.0\ul0\cf0}}}}\f1\fs24\par +\par +Unless required by applicable law or agreed to in writing, software distributed under the \par +License is distributed on an \ldblquote AS IS\rdblquote BASIS, WITHOUT WARRANTIES OR CONDI-\par +TIONS OF ANY KIND, either express or implied. See the License for the specific lang-\par +uage governing permissions and limitations under the License.\par +\par +\b Darkdetect\b0\par +\par +Copyright (c) 2019, Alberto Sottile\par +All rights reserved.\par +\par +Redistribution and use in source and binary forms, with or without\par +modification, are permitted provided that the following conditions are met:\par + * Redistributions of source code must retain the above copyright\par + notice, this list of conditions and the following disclaimer.\par + * Redistributions in binary form must reproduce the above copyright\par + notice, this list of conditions and the following disclaimer in the\par + documentation and/or other materials provided with the distribution.\par + * Neither the name of "darkdetect" nor the\par + names of its contributors may be used to endorse or promote products\par + derived from this software without specific prior written permission.\par +\par +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\par +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\par +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\par +DISCLAIMED. IN NO EVENT SHALL "Alberto Sottile" BE LIABLE FOR ANY\par +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\par +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\par +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\par +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\par +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\par +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\par +\par +\b Python MPV JSONIPC\par +\b0\f0\lang2057 Authors listed here: {{\field{\*\fldinst{HYPERLINK https://github.com/iwalton3/python-mpv-jsonipc/ }}{\fldrslt{https://github.com/iwalton3/python-mpv-jsonipc/\ul0\cf0}}}}\f0\fs24 (principal developer Ian Walton / iwalton3)\b\f1\lang9\par +\par +\b0 Licensed under the Apache License, Version 2.0 (the \ldblquote License\rdblquote ); you may not use this file\par +except in compliance with the License. You may obtain a copy of the License at\par +\par +{{\field{\*\fldinst{HYPERLINK http://www.apache.org/licenses/LICENSE-2.0 }}{\fldrslt{http://www.apache.org/licenses/LICENSE-2.0\ul0\cf0}}}}\f1\fs24\par +\par +Unless required by applicable law or agreed to in writing, software distributed under the \par +License is distributed on an \ldblquote AS IS\rdblquote BASIS, WITHOUT WARRANTIES OR CONDI-\par +TIONS OF ANY KIND, either express or implied. See the License for the specific lang-\par +uage governing permissions and limitations under the License.\par +\b\par +\par +Icons\par +\par +\b0 Syncplay uses the following icons and images:\par +\par +- Silk icon set 1.3\par +_________________________________________\par +Mark James\par +{{\field{\*\fldinst{HYPERLINK http://www.famfamfam.com/lab/icons/silk/ }}{\fldrslt{http://www.famfamfam.com/lab/icons/silk/\ul0\cf0}}}}\f1\fs24\par +_________________________________________\par +\par +This work is licensed under a\par +Creative Commons Attribution 2.5 License.\par +[ {{\field{\*\fldinst{HYPERLINK http://creativecommons.org/licenses/by/2.5/ }}{\fldrslt{http://creativecommons.org/licenses/by/2.5/\ul0\cf0}}}}\f1\fs24 ]\par +\par +This means you may use it for any purpose,\par +and make any changes you like.\par +All I ask is that you include a link back\par +to this page in your credits.\par +\par +Are you using this icon set? Send me an email\par +(including a link or picture if available) to\par +mjames@gmail.com\par +\par +Any other questions about this icon set please\par +contact mjames@gmail.com\par +\par +- Silk Companion 1\par +\par + +\pard Copyright Damien Guard - CC-BY 3.0\par +{{\field{\*\fldinst{HYPERLINK https://damieng.com/creative/icons/silk-companion-1-icons }}{\fldrslt{https://damieng.com/creative/icons/silk-companion-1-icons\ul0\cf0}}}}\f1\fs24\par +\par +- Padlock free icon\par +CC-BY 3.0\par +Icon made by Maxim Basinski from {{\field{\*\fldinst{HYPERLINK https://www.flaticon.com/free-icon/padlock_291248 }}{\fldrslt{https://www.flaticon.com/free-icon/padlock_291248\ul0\cf0}}}}\f1\fs24\par +\par + +\pard\tx529\par +} + \ No newline at end of file From 626f93ed6b41b871eba0cde2c3196b7556f58842 Mon Sep 17 00:00:00 2001 From: prez Date: Sat, 16 May 2020 12:49:12 +0200 Subject: [PATCH 067/112] client: actually fix the wildcard matching (#312) --- syncplay/client.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/syncplay/client.py b/syncplay/client.py index dcc715a..9dc55c8 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -9,6 +9,7 @@ import re import sys import threading import time +from fnmatch import fnmatch from copy import deepcopy from functools import wraps @@ -506,20 +507,14 @@ class SyncplayClient(object): return False def isURITrusted(self, URIToTest): - def sWildcardMatch(a, b): - splt = a.split('*') - if len(splt) == 1: - return b.startswith(a) - return b.startswith(splt[0]) and b.endswith(splt[-1]) - URIToTest = URIToTest+"/" for trustedProtocol in constants.TRUSTABLE_WEB_PROTOCOLS: if URIToTest.startswith(trustedProtocol): if self._config['onlySwitchToTrustedDomains']: if self._config['trustedDomains']: for trustedDomain in self._config['trustedDomains']: - trustableURI = ''.join([trustedProtocol, trustedDomain, "/"]) - if sWildcardMatch(trustableURI, URIToTest): + trustableURI = ''.join([trustedProtocol, trustedDomain, "/*"]) + if fnmatch(URIToTest, trustableURI): return True return False else: From 5df3046287523f3df65c350b91a429fe39152dcd Mon Sep 17 00:00:00 2001 From: et0h Date: Sat, 16 May 2020 12:44:14 +0100 Subject: [PATCH 068/112] Improve mpv error handling and display 'mpv-failed-advice' if load fails --- syncplay/messages_de.py | 1 + syncplay/messages_en.py | 1 + syncplay/messages_es.py | 1 + syncplay/messages_it.py | 1 + syncplay/messages_pt_BR.py | 1 + syncplay/messages_ru.py | 1 + syncplay/players/mpv.py | 28 +++++++++++++++++++++------- 7 files changed, 27 insertions(+), 7 deletions(-) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 63330bf..1610b84 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -107,6 +107,7 @@ de = { "mpc-version-insufficient-error": "MPC-Version nicht ausreichend, bitte nutze `mpc-hc` >= `{}`", "mpc-be-version-insufficient-error": "MPC-Version nicht ausreichend, bitte nutze `mpc-be` >= `{}`", "mpv-version-error": "Syncplay ist nicht kompatibel mit dieser Version von mpv. Bitte benutze eine andere Version (z.B. Git HEAD).", + "mpv-failed-advice": "The reason mpv cannot start may be due to the use of unsupported command line arguments or an unsupported version of mpv.", # TODO: Translate "player-file-open-error": "Fehler beim Öffnen der Datei durch den Player", "player-path-error": "Ungültiger Player-Pfad. Unterstützte Player sind: mpv, mpv.net, VLC, MPC-HC, MPC-BE und mplayer2", "hostname-empty-error": "Hostname darf nicht leer sein", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 0ad1f34..d6e6674 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -107,6 +107,7 @@ en = { "mpc-version-insufficient-error": "MPC version not sufficient, please use `mpc-hc` >= `{}`", "mpc-be-version-insufficient-error": "MPC version not sufficient, please use `mpc-be` >= `{}`", "mpv-version-error": "Syncplay is not compatible with this version of mpv. Please use a different version of mpv (e.g. Git HEAD).", + "mpv-failed-advice": "The reason mpv cannot start may be due to the use of unsupported command line arguments or an unsupported version of mpv.", "player-file-open-error": "Player failed opening file", "player-path-error": "Player path is not set properly. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2", "hostname-empty-error": "Hostname can't be empty", diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index 7763bbc..b2f8397 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -107,6 +107,7 @@ es = { "mpc-version-insufficient-error": "La versión de MPC no es suficiente, por favor utiliza `mpc-hc` >= `{}`", "mpc-be-version-insufficient-error": "La versión de MPC no es suficiente, por favor utiliza `mpc-be` >= `{}`", "mpv-version-error": "Syncplay no es compatible con esta versión de mpv. Por favor utiliza una versión diferente de mpv (p.ej. Git HEAD).", + "mpv-failed-advice": "The reason mpv cannot start may be due to the use of unsupported command line arguments or an unsupported version of mpv.", # TODO: Translate "player-file-open-error": "El reproductor falló al abrir el archivo", "player-path-error": "La ruta del reproductor no está definida correctamente. Los reproductores soportados son: mpv, mpv.net, VLC, MPC-HC, MPC-BE y mplayer2", "hostname-empty-error": "El nombre del host no puede ser vacío", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 7b41927..c7bda36 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -107,6 +107,7 @@ it = { "mpc-version-insufficient-error": "La tua versione di MPC è troppo vecchia, per favore usa `mpc-hc` >= `{}`", "mpc-be-version-insufficient-error": "La tua versione di MPC è troppo vecchia, per favore usa `mpc-be` >= `{}`", "mpv-version-error": "Syncplay non è compatibile con questa versione di mpv. Per favore usa un'altra versione di mpv (es. Git HEAD).", + "mpv-failed-advice": "The reason mpv cannot start may be due to the use of unsupported command line arguments or an unsupported version of mpv.", # TODO: Translate "player-file-open-error": "Il player non è riuscito ad aprire il file", "player-path-error": "Il path del player non è configurato correttamente. I player supportati sono: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2", "hostname-empty-error": "Il campo hostname non può essere vuoto", diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py index 15e2dff..1441958 100644 --- a/syncplay/messages_pt_BR.py +++ b/syncplay/messages_pt_BR.py @@ -107,6 +107,7 @@ pt_BR = { "mpc-version-insufficient-error": "A versão do MPC é muito antiga, por favor use `mpc-hc` >= `{}`", "mpc-be-version-insufficient-error": "A versão do MPC-BE é muito antiga, por favor use `mpc-be` >= `{}`", "mpv-version-error": "O Syncplay não é compatível com esta versão do mpv. Por favor, use uma versão diferente do mpv (por exemplo, Git HEAD).", + "mpv-failed-advice": "The reason mpv cannot start may be due to the use of unsupported command line arguments or an unsupported version of mpv.", # TODO: Translate "player-file-open-error": "O reprodutor falhou ao abrir o arquivo", "player-path-error": "O caminho até o arquivo executável do reprodutor não está configurado corretamente. Os reprodutores suportados são: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2", "hostname-empty-error": "O endereço do servidor não pode ser vazio", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 7d9b3a2..ba24b77 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -107,6 +107,7 @@ ru = { "mpc-version-insufficient-error": "Версия MPC слишком старая, пожалуйста, используйте `mpc-hc` >= `{}`", "mpc-be-version-insufficient-error": "Версия MPC слишком старая, пожалуйста, используйте `mpc-be` >= `{}`", "mpv-version-error": "Syncplay не совместим с данной версией mpv. Пожалуйста, используйте другую версию mpv (лучше свежайшую).", + "mpv-failed-advice": "The reason mpv cannot start may be due to the use of unsupported command line arguments or an unsupported version of mpv.", # TODO: Translate "player-file-open-error": "Проигрыватель не может открыть файл.", "player-path-error": "Путь к проигрывателю задан неверно. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2.", # TODO: Translate last sentence "hostname-empty-error": "Имя пользователя не может быть пустым.", diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index eaeb66d..f3fea5a 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -314,16 +314,22 @@ class MpvPlayer(BasePlayer): self._paused if self.fileLoaded else self._client.getGlobalPaused(), self.getCalculatedPosition()) def drop(self): - self._listener.sendLine(['quit']) + try: + self._listener.sendLine(['quit']) + except AttributeError as e: + self._client.ui.showDebugMessage("Could not send quit message: {}".format(str(e))) self._takeLocksDown() self.reactor.callFromThread(self._client.stop, False) def _takeLocksDown(self): - self._durationAsk.set() - self._filenameAsk.set() - self._pathAsk.set() - self._positionAsk.set() - self._pausedAsk.set() + try: + self._durationAsk.set() + self._filenameAsk.set() + self._pathAsk.set() + self._positionAsk.set() + self._pausedAsk.set() + except: + pass def _getPausedAndPosition(self): @@ -519,6 +525,9 @@ class MpvPlayer(BasePlayer): self._client.ui.showMessage(getMessage("mplayer-file-required-notification/example")) self.drop() return + except AttributeError as e: + self._client.ui.showErrorMessage("Could not load mpv: " + str(e)) + return self._listener.setDaemon(True) self._listener.start() @@ -588,7 +597,12 @@ class MpvPlayer(BasePlayer): if pythonPath is not None: env['PATH'] = '/usr/bin:/usr/local/bin' env['PYTHONPATH'] = pythonPath - self.mpvpipe = MPV(mpv_location=self.playerPath, loglevel="info", log_handler=self.__playerController.mpv_log_handler, quit_callback=self.stop_client, **self.mpv_arguments) + try: + self.mpvpipe = MPV(mpv_location=self.playerPath, loglevel="info", log_handler=self.__playerController.mpv_log_handler, quit_callback=self.stop_client, **self.mpv_arguments) + except Exception as e: + self.quitReason = getMessage("media-player-error").format(str(e)) + " " + getMessage("mpv-failed-advice") + self.__playerController.reactor.callFromThread(self.__playerController._client.ui.showErrorMessage, self.quitReason, True) + self.__playerController.drop() self.__process = self.mpvpipe #self.mpvpipe.show_text("HELLO WORLD!", 1000) threading.Thread.__init__(self, name="MPV Listener") From a74fef08ca600baf8c4e2170e86e5ca4b6060921 Mon Sep 17 00:00:00 2001 From: et0h Date: Sat, 16 May 2020 13:48:23 +0100 Subject: [PATCH 069/112] Ensure mpv playlist advancement works (even for MPVNet, #246) --- syncplay/constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/syncplay/constants.py b/syncplay/constants.py index 42da8b0..b0b59b2 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -241,6 +241,7 @@ MPV_ARGS = {'force-window': 'yes', 'keep-open': 'yes', 'input-terminal': 'no', 'term-playing-msg': '\nANS_filename=${filename}\nANS_length=${=duration:${=length:0}}\nANS_path=${path}\n', + 'keep-open-pause': 'yes' } From dafaf93441e6a1f0ab0c5725a4cd012ab9b39b6e Mon Sep 17 00:00:00 2001 From: et0h Date: Sat, 16 May 2020 15:42:57 +0100 Subject: [PATCH 070/112] Fix typo noted in #282 --- syncplay/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/client.py b/syncplay/client.py index 9dc55c8..2a52774 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -1901,7 +1901,7 @@ class FileSwitchManager(object): self.mediaDirectoriesNotFound = [] def setClient(self, newClient): - self.client = newClient + self._client = newClient def setCurrentDirectory(self, curDir): self.currentDirectory = curDir From 734b425c7f14adc437f50d46f92d050517c361c4 Mon Sep 17 00:00:00 2001 From: et0h Date: Sat, 16 May 2020 17:40:16 +0100 Subject: [PATCH 071/112] Don't enable DPI scaling in Linux (#257) --- syncplay/ui/gui.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index 27dcb87..5dfec61 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -21,10 +21,15 @@ from syncplay.utils import formatTime, sameFilename, sameFilesize, sameFiledurat from syncplay.vendor import Qt from syncplay.vendor.Qt import QtCore, QtWidgets, QtGui, __binding__, __binding_version__, __qt_version__, IsPySide, IsPySide2 from syncplay.vendor.Qt.QtCore import Qt, QSettings, QSize, QPoint, QUrl, QLine, QDateTime +applyDPIScaling = True +if isLinux(): + applyDPIScaling = False +else: + applyDPIScaling = True if hasattr(QtCore.Qt, 'AA_EnableHighDpiScaling'): - QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) + QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, applyDPIScaling) if hasattr(QtCore.Qt, 'AA_UseHighDpiPixmaps'): - QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) + QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, applyDPIScaling) if IsPySide2: from PySide2.QtCore import QStandardPaths if isMacOS() and IsPySide: From e831d4c83f9b1039519957e1c9cf8ff5cbbb7fce Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 17 May 2020 10:23:00 +0100 Subject: [PATCH 072/112] Explain managed rooms and auto-authentication (#216) --- syncplay/client.py | 2 +- syncplay/messages_de.py | 2 +- syncplay/messages_en.py | 2 +- syncplay/messages_es.py | 2 +- syncplay/messages_it.py | 2 +- syncplay/messages_pt_BR.py | 2 +- syncplay/messages_ru.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/syncplay/client.py b/syncplay/client.py index 2a52774..813f65c 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -957,7 +957,7 @@ class SyncplayClient(object): self._protocol.requestControlledRoom(roomName, controlPassword) def controlledRoomCreated(self, roomName, controlPassword): - self.ui.showMessage(getMessage("created-controlled-room-notification").format(roomName, controlPassword)) + self.ui.showMessage(getMessage("created-controlled-room-notification").format(roomName, controlPassword, roomName, roomName + ":" + controlPassword)) self.setRoom(roomName, resetAutoplay=True) self.sendRoom() self._protocol.requestControlledRoom(roomName, controlPassword) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 1610b84..eb3a810 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -47,7 +47,7 @@ de = { "identifying-as-controller-notification": "Identifiziere als Raumleiter mit Passwort „{}“...", # TODO: find a better translation to "room operator" "failed-to-identify-as-controller-notification": "{} konnte sich nicht als Raumleiter identifizieren.", "authenticated-as-controller-notification": "{} authentifizierte sich als Raumleiter", - "created-controlled-room-notification": "Gesteuerten Raum „{}“ mit Passwort „{}“ erstellt. Bitte diese Informationen für die Zukunft aufheben!", # RoomName, operatorPassword + "created-controlled-room-notification": "Gesteuerten Raum „{}“ mit Passwort „{}“ erstellt. Bitte diese Informationen für die Zukunft aufheben! \n\nIn managed rooms everyone is kept in sync with the room operator(s) who are the only ones who can pause, unpause, seek, and change the playlist.\n\nYou should ask regular viewers to join the room '{}' but the room operators can join the room '{}' to automatically authenticate themselves.", # RoomName, operatorPassword, roomName, roomName:operatorPassword # TODO: Translate "file-different-notification": "Deine Datei scheint sich von {}s zu unterscheiden", # User "file-differences-notification": "Deine Datei unterscheidet sich auf folgende Art: {}", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index d6e6674..7589321 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -47,7 +47,7 @@ en = { "identifying-as-controller-notification": "Identifying as room operator with password '{}'...", "failed-to-identify-as-controller-notification": "{} failed to identify as a room operator.", "authenticated-as-controller-notification": "{} authenticated as a room operator", - "created-controlled-room-notification": "Created managed room '{}' with password '{}'. Please save this information for future reference!", # RoomName, operatorPassword + "created-controlled-room-notification": "Created managed room '{}' with password '{}'. Please save this information for future reference!\n\nIn managed rooms everyone is kept in sync with the room operator(s) who are the only ones who can pause, unpause, seek, and change the playlist.\n\nYou should ask regular viewers to join the room '{}' but the room operators can join the room '{}' to automatically authenticate themselves.", # RoomName, operatorPassword, roomName, roomName:operatorPassword "file-different-notification": "File you are playing appears to be different from {}'s", # User "file-differences-notification": "Your file differs in the following way(s): {}", # Differences diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index b2f8397..33ede9b 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -47,7 +47,7 @@ es = { "identifying-as-controller-notification": "Autentificando como el operador de la sala, con contraseña '{}'...", "failed-to-identify-as-controller-notification": "{} falló la autentificación como operador de la sala.", "authenticated-as-controller-notification": "{} autentificado como operador de la sala", - "created-controlled-room-notification": "Sala administrada '{}' creada con contraseña '{}'. Por favor guarda esta información para referencias futuras!", # RoomName, operatorPassword + "created-controlled-room-notification": "Sala administrada '{}' creada con contraseña '{}'. Por favor guarda esta información para referencias futuras!\n\nIn managed rooms everyone is kept in sync with the room operator(s) who are the only ones who can pause, unpause, seek, and change the playlist.\n\nYou should ask regular viewers to join the room '{}' but the room operators can join the room '{}' to automatically authenticate themselves.", # RoomName, operatorPassword, roomName, roomName:operatorPassword # TODO: Translate "file-different-notification": "El archivo que reproduces parece ser diferente al archivo de {}", # User "file-differences-notification": "Tu archivo difiere de la(s) siguiente(s) forma(s): {}", # Differences diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index c7bda36..a03dfaa 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -47,7 +47,7 @@ it = { "identifying-as-controller-notification": "Ti sei identificato come gestore della stanza con password '{}'...", "failed-to-identify-as-controller-notification": "{} ha fallito l'identificazione come gestore della stanza.", "authenticated-as-controller-notification": "{} autenticato come gestore della stanza", - "created-controlled-room-notification": "Stanza gestita '{}' creata con password '{}'. Per favore salva queste informazioni per una consultazione futura!", # RoomName, operatorPassword + "created-controlled-room-notification": "Stanza gestita '{}' creata con password '{}'. Per favore salva queste informazioni per una consultazione futura!\n\nIn managed rooms everyone is kept in sync with the room operator(s) who are the only ones who can pause, unpause, seek, and change the playlist.\n\nYou should ask regular viewers to join the room '{}' but the room operators can join the room '{}' to automatically authenticate themselves.", # RoomName, operatorPassword, roomName, roomName:operatorPassword # TODO: Translate "file-different-notification": "Il file che stai riproducendo sembra essere diverso da quello di {}", # User "file-differences-notification": "Il tuo file mostra le seguenti differenze: {}", # Differences diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py index 1441958..bf1853a 100644 --- a/syncplay/messages_pt_BR.py +++ b/syncplay/messages_pt_BR.py @@ -47,7 +47,7 @@ pt_BR = { "identifying-as-controller-notification": "Identificando-se como operador da sala com a senha '{}'...", "failed-to-identify-as-controller-notification": "{} falhou ao se identificar como operador da sala.", "authenticated-as-controller-notification": "{} autenticou-se como um operador da sala", - "created-controlled-room-notification": "Criou a sala gerenciada '{}' com a senha '{}'. Por favor, salve essa informação para futura referência!", # RoomName, operatorPassword + "created-controlled-room-notification": "Criou a sala gerenciada '{}' com a senha '{}'. Por favor, salve essa informação para futura referência!\n\nIn managed rooms everyone is kept in sync with the room operator(s) who are the only ones who can pause, unpause, seek, and change the playlist.\n\nYou should ask regular viewers to join the room '{}' but the room operators can join the room '{}' to automatically authenticate themselves.", # RoomName, operatorPassword, roomName, roomName:operatorPassword # TODO: Translate "file-different-notification": "O arquivo que você está tocando parece ser diferente do arquivo de {}", # User "file-differences-notification": "Seus arquivos se diferem da(s) seguinte(s) forma(s): {}", # Differences diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index ba24b77..3f40b97 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -47,7 +47,7 @@ ru = { "identifying-as-controller-notification": "Идентификация как оператора комнаты с паролем '{}'...", "failed-to-identify-as-controller-notification": "{} не прошел идентификацию в качестве оператора комнаты.", "authenticated-as-controller-notification": "{} вошел как оператор комнаты.", - "created-controlled-room-notification": "Создана управляемая комната '{}' с паролем '{}'. Сохраните эти данные!", # RoomName, operatorPassword + "created-controlled-room-notification": "Создана управляемая комната '{}' с паролем '{}'. Сохраните эти данные!\n\nIn managed rooms everyone is kept in sync with the room operator(s) who are the only ones who can pause, unpause, seek, and change the playlist.\n\nYou should ask regular viewers to join the room '{}' but the room operators can join the room '{}' to automatically authenticate themselves.", # RoomName, operatorPassword, roomName, roomName:operatorPassword # TODO: Translate "file-different-notification": "Вероятно, файл, который Вы смотрите, отличается от того, который смотрит {}.", # User "file-differences-notification": "Ваш файл отличается: {}", # Differences From fbd474cd8ff84bd1eb48d663a8c4eeabdcf68a9f Mon Sep 17 00:00:00 2001 From: kidburglar Date: Sun, 17 May 2020 13:03:39 +0200 Subject: [PATCH 073/112] Add error message if SAN doesn't match hostname (#253) * Add error message if SAN doesn't match hostname * Add a better message for the error startTLS-server-certificate-invalid-DNS-ID and add the strings to the other languages --- syncplay/messages_de.py | 1 + syncplay/messages_en.py | 1 + syncplay/messages_es.py | 1 + syncplay/messages_it.py | 1 + syncplay/messages_ru.py | 1 + syncplay/protocols.py | 2 ++ 6 files changed, 7 insertions(+) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index eb3a810..62e5898 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -325,6 +325,7 @@ de = { "startTLS-initiated": "Sichere Verbindung wird versucht", "startTLS-secure-connection-ok": "Sichere Verbindung hergestellt ({})", "startTLS-server-certificate-invalid": 'Sichere Verbindung fehlgeschlagen. Der Server benutzt ein ungültiges Sicherheitszertifikat. Der Kanal könnte von Dritten abgehört werden. Für weitere Details und Problemlösung siehe hier [Englisch].', + "startTLS-server-certificate-invalid-DNS-ID": "Syncplay does not trust this server because it uses a certificate that is not valid for its hostname.", # TODO: Translate "startTLS-not-supported-client": "Dieser Server unterstützt kein TLS", "startTLS-not-supported-server": "Dieser Server unterstützt kein TLS", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 7589321..9e1557b 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -326,6 +326,7 @@ en = { "startTLS-initiated": "Attempting secure connection", "startTLS-secure-connection-ok": "Secure connection established ({})", "startTLS-server-certificate-invalid": 'Secure connection failed. The server uses an invalid security certificate. This communication could be intercepted by a third party. For further details and troubleshooting see here.', + "startTLS-server-certificate-invalid-DNS-ID": "Syncplay does not trust this server because it uses a certificate that is not valid for its hostname.", "startTLS-not-supported-client": "This client does not support TLS", "startTLS-not-supported-server": "This server does not support TLS", diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index 33ede9b..b998f3c 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -326,6 +326,7 @@ es = { "startTLS-initiated": "Intentando conexión segura", "startTLS-secure-connection-ok": "Conexión segura establecida ({})", "startTLS-server-certificate-invalid": 'Falló la conexión segura. El servidor utiliza un certificado inválido. Esta comunicación podría ser interceptada por un tercero. Para más detalles y solución de problemas, consulta aquí.', + "startTLS-server-certificate-invalid-DNS-ID": "Syncplay does not trust this server because it uses a certificate that is not valid for its hostname.", # TODO: Translate "startTLS-not-supported-client": "Este cliente no soporta TLS", "startTLS-not-supported-server": "Este servidor no soporta TLS", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index a03dfaa..b0ea6cd 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -326,6 +326,7 @@ it = { "startTLS-initiated": "Tentativo di connessione sicura in corso", "startTLS-secure-connection-ok": "Connessione sicura stabilita ({})", "startTLS-server-certificate-invalid": 'Connessione sicura non riuscita. Il certificato di sicurezza di questo server non è valido. La comunicazione potrebbe essere intercettata da una terza parte. Per ulteriori dettagli e informazioni sulla risoluzione del problema, clicca qui.', + "startTLS-server-certificate-invalid-DNS-ID": "Syncplay does not trust this server because it uses a certificate that is not valid for its hostname.", # TODO: Translate "startTLS-not-supported-client": "Questo client non supporta TLS", "startTLS-not-supported-server": "Questo server non supporta TLS", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 3f40b97..26efbb8 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -329,6 +329,7 @@ ru = { "startTLS-initiated": "Attempting secure connection", "startTLS-secure-connection-ok": "Secure connection established ({})", "startTLS-server-certificate-invalid": 'Secure connection failed. The server uses an invalid security certificate. This communication could be intercepted by a third party. For further details and troubleshooting see here.', + "startTLS-server-certificate-invalid-DNS-ID": "Syncplay does not trust this server because it uses a certificate that is not valid for its hostname.", "startTLS-not-supported-client": "This client does not support TLS", "startTLS-not-supported-server": "This server does not support TLS", diff --git a/syncplay/protocols.py b/syncplay/protocols.py index 3bf0902..d13d07f 100755 --- a/syncplay/protocols.py +++ b/syncplay/protocols.py @@ -99,6 +99,8 @@ class SyncClientProtocol(JSONCommandProtocol): self._client._clientSupportsTLS = False elif "certificate verify failed" in str(reason.value): self.dropWithError(getMessage("startTLS-server-certificate-invalid")) + elif "mismatched_id=DNS_ID" in str(reason.value): + self.dropWithError(getMessage("startTLS-server-certificate-invalid-DNS-ID")) except: pass self._client.destroyProtocol() From 656936a4c7c77e885a704ef089535b921261285a Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 17 May 2020 12:13:11 +0100 Subject: [PATCH 074/112] Improve message consistency --- syncplay/messages_de.py | 2 +- syncplay/messages_en.py | 4 ++-- syncplay/messages_es.py | 2 +- syncplay/messages_it.py | 2 +- syncplay/messages_pt_BR.py | 3 ++- syncplay/messages_ru.py | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 62e5898..13331a0 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -373,7 +373,7 @@ de = { "password-tooltip": "Passwörter sind nur bei Verbindung zu privaten Servern nötig.", "room-tooltip": "Der Raum, der betreten werden soll, kann ein x-beliebiger sein. Allerdings werden nur Clients im selben Raum synchronisiert.", - "executable-path-tooltip": "Pfad zum ausgewählten, unterstützten Mediaplayer (MPC-HC, MPC-BE, VLC, mplayer2 or mpv).", + "executable-path-tooltip": "Pfad zum ausgewählten, unterstützten Mediaplayer (mpv, mpv.net, VLC, MPC-HC/BE or mplayer2).", "media-path-tooltip": "Pfad zum wiederzugebenden Video oder Stream. Notwendig für mplayer2.", "player-arguments-tooltip": "Zusätzliche Kommandozeilenparameter/-schalter für diesen Mediaplayer.", "mediasearcdirectories-arguments-tooltip": "Verzeichnisse, in denen Syncplay nach Mediendateien suchen soll, z.B. wenn du die Click-to-switch-Funktion verwendest. Syncplay wird Unterverzeichnisse rekursiv durchsuchen.", # TODO: Translate Click-to-switch? (or use as name for feature) diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 9e1557b..9576967 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -374,7 +374,7 @@ en = { "password-tooltip": "Passwords are only needed for connecting to private servers.", "room-tooltip": "Room to join upon connection can be almost anything, but you will only be synchronised with people in the same room.", - "executable-path-tooltip": "Location of your chosen supported media player (mpv, VLC, MPC-HC/BE or mplayer2).", + "executable-path-tooltip": "Location of your chosen supported media player (mpv, mpv.net, VLC, MPC-HC/BE or mplayer2).", "media-path-tooltip": "Location of video or stream to be opened. Necessary for mplayer2.", "player-arguments-tooltip": "Additional command line arguments / switches to pass on to this media player.", "mediasearcdirectories-arguments-tooltip": "Directories where Syncplay will search for media files, e.g. when you are using the click to switch feature. Syncplay will look recursively through sub-folders.", @@ -454,7 +454,7 @@ en = { # Server arguments - "server-argument-description": 'Solution to synchronize playback of multiple MPlayer and MPC-HC/BE instances over the network. Server instance', + "server-argument-description": 'Solution to synchronize playback of multiple media player instances over the network. Server instance', "server-argument-epilog": 'If no options supplied _config values will be used', "server-port-argument": 'server TCP port', "server-password-argument": 'server password', diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index b998f3c..4cfca73 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -374,7 +374,7 @@ es = { "password-tooltip": "Las contraseñas son sólo necesarias para conectarse a servidores privados.", "room-tooltip": "La sala para unirse en la conexión puede ser casi cualquier cosa, pero sólo se sincronizará con las personas en la misma sala.", - "executable-path-tooltip": "Ubicación de tu reproductor multimedia compatible elegido (mpv, VLC, MPC-HC/BE o mplayer2).", + "executable-path-tooltip": "Ubicación de tu reproductor multimedia compatible elegido (mpv, mpv.net, VLC, MPC-HC/BE o mplayer2).", "media-path-tooltip": "Ubicación del video o flujo que se abrirá. Necesario para mplayer2.", "player-arguments-tooltip": "Arguementos de línea de comandos adicionales / parámetros para pasar a este reproductor multimedia.", "mediasearcdirectories-arguments-tooltip": "Directorios donde Syncplay buscará archivos de medios, p.ej. cuando estás usando la función \"clic para cambiar\". Syncplay buscará recursivamente a través de las subcarpetas.", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index b0ea6cd..4e0d98c 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -374,7 +374,7 @@ it = { "password-tooltip": "La password è necessaria solo in caso di connessione a server privati.", "room-tooltip": "La stanza in cui entrare dopo la connessione. Può assumere qualsiasi nome, ma ricorda che sarai sincronizzato solo con gli utenti nella stessa stanza.", - "executable-path-tooltip": "Percorso del media player desiderato (scegliere tra mpv, VLC, MPC-HC/BE or mplayer2).", + "executable-path-tooltip": "Percorso del media player desiderato (scegliere tra mpv, mpv.net, VLC, MPC-HC/BE or mplayer2).", "media-path-tooltip": "Percorso del video o stream da aprire. Necessario per mplayer2.", "player-arguments-tooltip": "Argomenti da linea di comando aggiuntivi da passare al media player scelto.", "mediasearcdirectories-arguments-tooltip": "Cartelle dove Syncplay cercherà i file multimediali, es. quando usi la funzione click to switch. Syncplay cercherà anche nelle sottocartelle.", diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py index bf1853a..a277714 100644 --- a/syncplay/messages_pt_BR.py +++ b/syncplay/messages_pt_BR.py @@ -326,6 +326,7 @@ pt_BR = { "startTLS-initiated": "Tentando estabelecer conexão segura", "startTLS-secure-connection-ok": "Conexão segura estabelecida ({})", "startTLS-server-certificate-invalid": 'Não foi possível estabelecer uma conexão segura. O servidor usa um certificado de segurança inválido. Essa comunicação pode ser interceptada por terceiros. Para mais detalhes de solução de problemas, consulte aqui.', + "startTLS-server-certificate-invalid-DNS-ID": "Syncplay does not trust this server because it uses a certificate that is not valid for its hostname.", # TODO: Translate "startTLS-not-supported-client": "Este client não possui suporte para TLS", "startTLS-not-supported-server": "Este servidor não possui suporte para TLS", @@ -373,7 +374,7 @@ pt_BR = { "password-tooltip": "Senhas são necessárias apenas para servidores privados.", "room-tooltip": "O nome da sala para se conectar pode ser praticamente qualquer coisa, mas você só irá se sincronizar com pessoas na mesma sala.", - "executable-path-tooltip": "Localização do seu reprodutor de mídia preferido (mpv, VLC, MPC-HC/BE ou mplayer2).", + "executable-path-tooltip": "Localização do seu reprodutor de mídia preferido (mpv, mpv.net, VLC, MPC-HC/BE ou mplayer2).", "media-path-tooltip": "Localização do vídeo ou transmissão a ser aberto. Necessário com o mplayer2.", "player-arguments-tooltip": "Argumentos de comando de linha adicionais para serem repassados ao reprodutor de mídia.", "mediasearcdirectories-arguments-tooltip": "Diretório onde o Syncplay vai procurar por arquivos de mídia, por exemplo quando você estiver usando o recurso de clicar para mudar. O Syncplay irá procurar recursivamente pelas subpastas.", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 26efbb8..aa314af 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -377,7 +377,7 @@ ru = { "password-tooltip": "Пароли нужны для подключения к приватным серверам.", "room-tooltip": "Комната, в которую Вы попадете сразу после подключения. Синхронизация возможна только между людьми в одной и той же комнате.", - "executable-path-tooltip": "Расположение Вашего видеопроигрывателя (MPC-HC, MPC-BE, VLC, mplayer2 или mpv).", + "executable-path-tooltip": "Расположение Вашего видеопроигрывателя (mpv, mpv.net, VLC, MPC-HC/BE или mplayer2).", "media-path-tooltip": "Расположение видеофайла или потока для просмотра. Обязательно для mplayer2.", # TODO: Confirm translation "player-arguments-tooltip": "Передавать дополнительные аргументы командной строки этому проигрывателю.", "mediasearcdirectories-arguments-tooltip": "Папки, где Syncplay будет искать медиа файлы, включая подпапки.", From 4dbf57e62626f24cb174319e65eec9e7d6060e68 Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 17 May 2020 19:41:36 +0100 Subject: [PATCH 075/112] Fix seamless playlist advancement for music (#302) --- syncplay/client.py | 25 ++++++++++++++++++------- syncplay/constants.py | 2 +- syncplay/players/mpv.py | 5 ----- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/syncplay/client.py b/syncplay/client.py index 813f65c..af0158f 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -76,6 +76,7 @@ class SyncplayClient(object): self.serverFeatures = {} self.lastRewindTime = None + self.lastAdvanceTime = None self.lastLeftTime = 0 self.lastPausedOnLeaveTime = None self.lastLeftUser = "" @@ -206,6 +207,9 @@ class SyncplayClient(object): if self.userlist.currentUser.file['name'].lower().endswith(musicFormat): return True + def seamlessMusicOveride(self): + return self.isPlayingMusic() and self._recentlyAdvanced() + def updatePlayerStatus(self, paused, position): position -= self.getUserOffset() pauseChange, seeked = self._determinePlayerStateChange(paused, position) @@ -230,9 +234,7 @@ class SyncplayClient(object): if self._lastGlobalUpdate: self._lastPlayerUpdate = time.time() - if seeked and not pauseChange and self.isPlayingMusic() and abs(positionBeforeSeek - currentLength) < constants.PLAYLIST_LOAD_NEXT_FILE_TIME_FROM_END_THRESHOLD and self.playlist.notJustChangedPlaylist(): - self.playlist.loadNextFileInPlaylist() - elif (pauseChange or seeked) and self._protocol: + if (pauseChange or seeked) and self._protocol: if seeked: self.playerPositionBeforeLastSeek = self.getGlobalPosition() self._protocol.sendState(self.getPlayerPosition(), self.getPlayerPaused(), seeked, None, True) @@ -240,13 +242,16 @@ class SyncplayClient(object): def prepareToAdvancePlaylist(self): if self.playlist.canSwitchToNextPlaylistIndex(): self.ui.showDebugMessage("Preparing to advance playlist...") - if self.isPlayingMusic(): - self._protocol.sendState(0, False, True, None, True) - else: - self._protocol.sendState(0, True, True, None, True) + self.lastAdvanceTime = time.time() + self._protocol.sendState(0, True, True, None, True) else: self.ui.showDebugMessage("Not preparing to advance playlist because the next file cannot be switched to") + def _recentlyAdvanced(self): + lastAdvandedDiff = time.time() - self.lastAdvanceTime if self.lastAdvanceTime else None + if lastAdvandedDiff is not None and lastAdvandedDiff < constants.LAST_PAUSED_DIFF_THRESHOLD: + return True + def _toggleReady(self, pauseChange, paused): if not self.userlist.currentUser.canControl(): self._player.setPaused(self._globalPaused) @@ -257,6 +262,10 @@ class SyncplayClient(object): self.ui.showMessage(getMessage("set-as-not-ready-notification")) else: self.ui.showMessage(getMessage("set-as-ready-notification")) + elif self.seamlessMusicOveride(): + self.ui.showDebugMessage("Readiness toggle ignored due to seamless music override") + self._player.setPaused(paused) + self._playerPaused = paused elif not paused and not self.instaplayConditionsMet(): paused = True self._player.setPaused(paused) @@ -886,6 +895,8 @@ class SyncplayClient(object): return False def autoplayConditionsMet(self): + if self.seamlessMusicOveride(): + self.setPaused(False) recentlyReset = (self.lastRewindTime is not None and abs(time.time() - self.lastRewindTime) < 10) and self._playerPosition < 3 return ( self._playerPaused and (self.autoPlay or recentlyReset) and diff --git a/syncplay/constants.py b/syncplay/constants.py index b0b59b2..3c35acc 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -238,7 +238,7 @@ MPLAYER_SLAVE_ARGS = ['-slave', '--hr-seek=always', '-nomsgcolor', '-msglevel', MPV_ARGS = {'force-window': 'yes', 'idle': 'yes', 'hr-seek': 'always', - 'keep-open': 'yes', + 'keep-open': 'always', 'input-terminal': 'no', 'term-playing-msg': '\nANS_filename=${filename}\nANS_length=${=duration:${=length:0}}\nANS_path=${path}\n', 'keep-open-pause': 'yes' diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index f3fea5a..cc22d84 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -216,11 +216,6 @@ class MpvPlayer(BasePlayer): if value is None: self._client.ui.showDebugMessage("NONE TYPE POSITION!") return - - if self._client.isPlayingMusic() and self._paused == False and self._position == value and abs(self._position-self._position) < 0.5: - self._client.ui.showDebugMessage("EOF DETECTED!") - self._position = 0 - self.setPosition(0) self.lastMPVPositionUpdate = time.time() if self._recentlyReset(): self._client.ui.showDebugMessage("Recently reset, so storing position as 0") From fea3432dd5e65becfda6514c899236047541b4f1 Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 17 May 2020 19:55:51 +0100 Subject: [PATCH 076/112] Don't warn of being alone if only just connected --- syncplay/client.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/syncplay/client.py b/syncplay/client.py index af0158f..51ec2f5 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -77,6 +77,7 @@ class SyncplayClient(object): self.lastRewindTime = None self.lastAdvanceTime = None + self.lastConnectTime = None self.lastLeftTime = 0 self.lastPausedOnLeaveTime = None self.lastLeftUser = "" @@ -252,6 +253,11 @@ class SyncplayClient(object): if lastAdvandedDiff is not None and lastAdvandedDiff < constants.LAST_PAUSED_DIFF_THRESHOLD: return True + def recentlyConnected(self): + connectDiff = time.time() - self.lastConnectTime if self.lastConnectTime else None + if connectDiff is None or connectDiff < constants.LAST_PAUSED_DIFF_THRESHOLD: + return True + def _toggleReady(self, pauseChange, paused): if not self.userlist.currentUser.canControl(): self._player.setPaused(self._globalPaused) @@ -691,6 +697,7 @@ class SyncplayClient(object): return sharedPlaylistEnabled def connected(self): + self.lastConnectTime = time.time() readyState = self._config['readyAtStart'] if self.userlist.currentUser.isReady() is None else self.userlist.currentUser.isReady() self._protocol.setReady(readyState, manuallyInitiated=False) self.reIdentifyAsController() @@ -1414,6 +1421,8 @@ class SyncplayUserlist(object): return True def areYouAloneInRoom(self): + if self._client.recentlyConnected(): + return False for user in self._users.values(): if user.room == self.currentUser.room: return False From 7d1fda5521afd9687c91a07c5c10b927d1d2bfc7 Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 17 May 2020 20:06:29 +0100 Subject: [PATCH 077/112] Fix erroneous seeks when joining an active room --- syncplay/client.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/syncplay/client.py b/syncplay/client.py index 51ec2f5..184e7d4 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -78,6 +78,7 @@ class SyncplayClient(object): self.lastRewindTime = None self.lastAdvanceTime = None self.lastConnectTime = None + self.lastSetRoomTime = None self.lastLeftTime = 0 self.lastPausedOnLeaveTime = None self.lastLeftUser = "" @@ -185,7 +186,7 @@ class SyncplayClient(object): pauseChange = self.getPlayerPaused() != paused and self.getGlobalPaused() != paused _playerDiff = abs(self.getPlayerPosition() - position) _globalDiff = abs(self.getGlobalPosition() - position) - seeked = _playerDiff > constants.SEEK_THRESHOLD and _globalDiff > constants.SEEK_THRESHOLD + seeked = _playerDiff > constants.SEEK_THRESHOLD and _globalDiff > constants.SEEK_THRESHOLD and not self.recentlySetRoom() return pauseChange, seeked def rewindFile(self): @@ -258,6 +259,11 @@ class SyncplayClient(object): if connectDiff is None or connectDiff < constants.LAST_PAUSED_DIFF_THRESHOLD: return True + def recentlySetRoom(self): + setroomDiff = time.time() - self.lastSetRoomTime if self.lastSetRoomTime else None + if setroomDiff is None or setroomDiff < constants.LAST_PAUSED_DIFF_THRESHOLD: + return True + def _toggleReady(self, pauseChange, paused): if not self.userlist.currentUser.canControl(): self._player.setPaused(self._globalPaused) @@ -661,6 +667,7 @@ class SyncplayClient(object): return features def setRoom(self, roomName, resetAutoplay=False): + self.lastSetRoomTime = time.time() roomSplit = roomName.split(":") if roomName.startswith("+") and len(roomSplit) > 2: roomName = roomSplit[0] + ":" + roomSplit[1] From f8b8032ef6e84e808e9ff861ad50846fbd97c237 Mon Sep 17 00:00:00 2001 From: et0h Date: Sat, 23 May 2020 16:55:22 +0100 Subject: [PATCH 078/112] Re-work handling of sync on join and playlist change (#280) --- syncplay/client.py | 66 ++++++++++++++++++++++++++++------------- syncplay/constants.py | 1 + syncplay/players/mpc.py | 2 ++ syncplay/protocols.py | 13 +++++++- 4 files changed, 61 insertions(+), 21 deletions(-) diff --git a/syncplay/client.py b/syncplay/client.py index 184e7d4..3ba8c24 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -76,9 +76,12 @@ class SyncplayClient(object): self.serverFeatures = {} self.lastRewindTime = None + self.lastUpdatedFileTime = None self.lastAdvanceTime = None self.lastConnectTime = None self.lastSetRoomTime = None + self.hadFirstPlaylistIndex = False + self.hadFirstStateUpdate = False self.lastLeftTime = 0 self.lastPausedOnLeaveTime = None self.lastLeftUser = "" @@ -186,21 +189,23 @@ class SyncplayClient(object): pauseChange = self.getPlayerPaused() != paused and self.getGlobalPaused() != paused _playerDiff = abs(self.getPlayerPosition() - position) _globalDiff = abs(self.getGlobalPosition() - position) - seeked = _playerDiff > constants.SEEK_THRESHOLD and _globalDiff > constants.SEEK_THRESHOLD and not self.recentlySetRoom() + seeked = _playerDiff > constants.SEEK_THRESHOLD and _globalDiff > constants.SEEK_THRESHOLD return pauseChange, seeked def rewindFile(self): - self.setPosition(-1) + self.setPosition(0) self.establishRewindDoubleCheck() def establishRewindDoubleCheck(self): - reactor.callLater(0.5, self.doubleCheckRewindFile,) - reactor.callLater(1, self.doubleCheckRewindFile,) - reactor.callLater(1.5, self.doubleCheckRewindFile,) + if constants.DOUBLE_CHECK_REWIND: + reactor.callLater(0.5, self.doubleCheckRewindFile,) + reactor.callLater(1, self.doubleCheckRewindFile,) + reactor.callLater(1.5, self.doubleCheckRewindFile,) + return def doubleCheckRewindFile(self): if self.getStoredPlayerPosition() > 5: - self.setPosition(-1) + self.setPosition(0) self.ui.showDebugMessage("Rewinded after double-check") def isPlayingMusic(self): @@ -251,7 +256,7 @@ class SyncplayClient(object): def _recentlyAdvanced(self): lastAdvandedDiff = time.time() - self.lastAdvanceTime if self.lastAdvanceTime else None - if lastAdvandedDiff is not None and lastAdvandedDiff < constants.LAST_PAUSED_DIFF_THRESHOLD: + if lastAdvandedDiff is not None and lastAdvandedDiff < constants.AUTOPLAY_DELAY + 5: return True def recentlyConnected(self): @@ -259,15 +264,17 @@ class SyncplayClient(object): if connectDiff is None or connectDiff < constants.LAST_PAUSED_DIFF_THRESHOLD: return True - def recentlySetRoom(self): - setroomDiff = time.time() - self.lastSetRoomTime if self.lastSetRoomTime else None - if setroomDiff is None or setroomDiff < constants.LAST_PAUSED_DIFF_THRESHOLD: - return True + def recentlyRewound(self, recentRewindThreshold = 5.0): + lastRewindTime = self.lastRewindTime + if lastRewindTime and self.lastUpdatedFileTime and self.lastUpdatedFileTime > lastRewindTime: + lastRewindTime = self.lastRewindTime - 4.5 + return lastRewindTime is not None and abs(time.time() - lastRewindTime) < recentRewindThreshold def _toggleReady(self, pauseChange, paused): if not self.userlist.currentUser.canControl(): self._player.setPaused(self._globalPaused) - self.toggleReady(manuallyInitiated=True) + if not self.recentlyRewound() and not ((self._globalPaused == True) and not self._recentlyAdvanced()): + self.toggleReady(manuallyInitiated=True) self._playerPaused = self._globalPaused pauseChange = False if self.userlist.currentUser.isReady(): @@ -278,6 +285,10 @@ class SyncplayClient(object): self.ui.showDebugMessage("Readiness toggle ignored due to seamless music override") self._player.setPaused(paused) self._playerPaused = paused + elif (self.recentlyRewound() and (self._globalPaused == True) and not self._recentlyAdvanced()): + self._player.setPaused(self._globalPaused) + self._playerPaused = self._globalPaused + pauseChange = False elif not paused and not self.instaplayConditionsMet(): paused = True self._player.setPaused(paused) @@ -489,6 +500,7 @@ class SyncplayClient(object): return self._globalPaused def updateFile(self, filename, duration, path): + self.lastUpdatedFileTime = time.time() newPath = "" if utils.isURL(path): filename = path @@ -550,6 +562,7 @@ class SyncplayClient(object): self.playlist.openedFile() self._player.openFile(filePath, resetPosition) if resetPosition: + self.rewindFile() self.establishRewindDoubleCheck() self.lastRewindTime = time.time() self.autoplayCheck() @@ -911,12 +924,12 @@ class SyncplayClient(object): def autoplayConditionsMet(self): if self.seamlessMusicOveride(): self.setPaused(False) - recentlyReset = (self.lastRewindTime is not None and abs(time.time() - self.lastRewindTime) < 10) and self._playerPosition < 3 + recentlyAdvanced = self._recentlyAdvanced() return ( - self._playerPaused and (self.autoPlay or recentlyReset) and + self._playerPaused and (self.autoPlay or recentlyAdvanced) and self.userlist.currentUser.canControl() and self.userlist.isReadinessSupported() and self.userlist.areAllUsersInRoomReady(requireSameFilenames=self._config["autoplayRequireSameFilenames"]) - and ((self.autoPlayThreshold and self.userlist.usersInRoomCount() >= self.autoPlayThreshold) or recentlyReset) + and ((self.autoPlayThreshold and self.userlist.usersInRoomCount() >= self.autoPlayThreshold) or recentlyAdvanced) ) def autoplayTimerIsRunning(self): @@ -1618,6 +1631,7 @@ class UiManager(object): class SyncplayPlaylist(): def __init__(self, client): + self.queuedIndex = None self._client = client self._ui = self._client.ui self._previousPlaylist = None @@ -1643,11 +1657,15 @@ class SyncplayPlaylist(): try: index = self._playlist.index(filename) if index != self._playlistIndex: - self.changeToPlaylistIndex(index) + self.changeToPlaylistIndex(index, resetPosition=True) + else: + if filename == self.queuedIndexFilename: + return + self._client.rewindFile() except ValueError: pass - def changeToPlaylistIndex(self, index, username=None): + def changeToPlaylistIndex(self, index, username=None, resetPosition=False): if self._playlist is None or len(self._playlist) == 0: return if index is None: @@ -1674,10 +1692,12 @@ class SyncplayPlaylist(): self._playlistIndex = index if username is None: if self._client.isConnectedAndInARoom() and self._client.sharedPlaylistIsEnabled(): + if resetPosition: + self._client.rewindFile() self._client.setPlaylistIndex(index) - else: + elif index is not None: self._ui.showMessage(getMessage("playlist-selection-changed-notification").format(username)) - self.switchToNewPlaylistIndex(index) + self.switchToNewPlaylistIndex(index, resetPosition=resetPosition) def canSwitchToNextPlaylistIndex(self): if self._thereIsNextPlaylistIndex() and self._client.sharedPlaylistIsEnabled(): @@ -1696,7 +1716,12 @@ class SyncplayPlaylist(): return False @needsSharedPlaylistsEnabled - def switchToNewPlaylistIndex(self, index, resetPosition=False): + def switchToNewPlaylistIndex(self, index, resetPosition = False): + try: + self.queuedIndexFilename = self._playlist[index] + except: + self.queuedIndexFilename = None + self._ui.showDebugMessage("Failed to find index {} in plauylist".format(index)) self._lastPlaylistIndexChange = time.time() if self._client.playerIsNotReady(): self._client.addPlayerReadyCallback(lambda x: self.switchToNewPlaylistIndex(index, resetPosition)) @@ -1773,6 +1798,7 @@ class SyncplayPlaylist(): def changePlaylist(self, files, username=None, resetIndex=False): + self.queuedIndexFilename = None if self._playlist == files: if self._playlistIndex != 0 and resetIndex: self.changeToPlaylistIndex(0) diff --git a/syncplay/constants.py b/syncplay/constants.py index 3c35acc..a40e9ac 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -109,6 +109,7 @@ FOLDER_SEARCH_TIMEOUT = 20.0 # Secs - How long to wait until searches in folder FOLDER_SEARCH_DOUBLE_CHECK_INTERVAL = 30.0 # Secs - Frequency of updating cache # Usually there's no need to adjust these +DOUBLE_CHECK_REWIND = False LAST_PAUSED_DIFF_THRESHOLD = 2 FILENAME_STRIP_REGEX = "[-~_\.\[\](): ]" CONTROL_PASSWORD_STRIP_REGEX = "[^a-zA-Z0-9\-]" diff --git a/syncplay/players/mpc.py b/syncplay/players/mpc.py index 88d684c..68f7e9b 100755 --- a/syncplay/players/mpc.py +++ b/syncplay/players/mpc.py @@ -406,6 +406,8 @@ class MPCHCAPIPlayer(BasePlayer): def openFile(self, filePath, resetPosition=False): self._mpcApi.openFile(filePath) + if resetPosition: + self.setPosition(0) def displayMessage( self, message, diff --git a/syncplay/protocols.py b/syncplay/protocols.py index d13d07f..aef41da 100755 --- a/syncplay/protocols.py +++ b/syncplay/protocols.py @@ -73,12 +73,16 @@ class SyncClientProtocol(JSONCommandProtocol): self.clientIgnoringOnTheFly = 0 self.serverIgnoringOnTheFly = 0 self.logged = False + self.hadFirstPlaylistIndex = False + self.hadFirstStateUpdate = False self._pingService = PingService() def showDebugMessage(self, line): self._client.ui.showDebugMessage(line) def connectionMade(self): + self.hadFirstPlaylistIndex = False + self.hadFirstStateUpdate = False self._client.initProtocol(self) if self._client._clientSupportsTLS: if self._client._serverSupportsTLS: @@ -183,7 +187,12 @@ class SyncClientProtocol(JSONCommandProtocol): manuallyInitiated = values["manuallyInitiated"] if "manuallyInitiated" in values else True self._client.setReady(user, isReady, manuallyInitiated) elif command == "playlistIndex": - self._client.playlist.changeToPlaylistIndex(values['index'], values['user']) + user = values['user'] + resetPosition = True + if not self.hadFirstPlaylistIndex: + self.hadFirstPlaylistIndex = True + resetPosition = False + self._client.playlist.changeToPlaylistIndex(values['index'], user, resetPosition=resetPosition) elif command == "playlistChange": self._client.playlist.changePlaylist(values['files'], values['user']) elif command == "features": @@ -245,6 +254,8 @@ class SyncClientProtocol(JSONCommandProtocol): def handleState(self, state): position, paused, doSeek, setBy = None, None, None, None messageAge = 0 + if not self.hadFirstStateUpdate: + self.hadFirstStateUpdate = True if "ignoringOnTheFly" in state: ignore = state["ignoringOnTheFly"] if "server" in ignore: From aa5e7d8965f8ee4e97d60a54afb4cf5ffe5c8b9e Mon Sep 17 00:00:00 2001 From: Etoh Date: Sat, 23 May 2020 16:59:47 +0100 Subject: [PATCH 079/112] Add Turkish characters to mpv chat input (#314) --- syncplay/resources/syncplayintf.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/resources/syncplayintf.lua b/syncplay/resources/syncplayintf.lua index 09add0a..677a781 100644 --- a/syncplay/resources/syncplayintf.lua +++ b/syncplay/resources/syncplayintf.lua @@ -77,7 +77,7 @@ non_us_chars = { 'И','и','Й','й','К','к','Л','л','М','м','Н','н','О','о','П','п', 'Р','р','С','с','Т','т','У','у','Ф','ф','Х','х','Ц','ц','Ч','ч', 'Ш','ш','Щ','щ','Ъ','ъ','Ы','ы','Ь','ь','Э','э','Ю','ю','Я','я', - '≥','≠' + '≥','≠','Ğ','Ş','ı','ğ','ş' } function format_scrolling(xpos, ypos, text) From ad48498367f2bb8807f72eaaeff3eeb09ba58272 Mon Sep 17 00:00:00 2001 From: et0h Date: Mon, 25 May 2020 10:57:38 +0100 Subject: [PATCH 080/112] Reduce disruption when connecting with a path specified (#315) --- syncplay/client.py | 58 +++++++++++++++++++++++++++++++++++++++- syncplay/constants.py | 1 + syncplay/ui/consoleUI.py | 3 +++ 3 files changed, 61 insertions(+), 1 deletion(-) diff --git a/syncplay/client.py b/syncplay/client.py index 3ba8c24..a712390 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -61,6 +61,7 @@ class SyncClientFactory(ClientFactory): class SyncplayClient(object): def __init__(self, playerClass, ui, config): + self.delayedLoadPath = None constants.SHOW_OSD = config['showOSD'] constants.SHOW_OSD_WARNINGS = config['showOSDWarnings'] constants.SHOW_SLOWDOWN_OSD = config['showSlowdownOSD'] @@ -781,7 +782,11 @@ class SyncplayClient(object): perPlayerArguments = utils.getPlayerArgumentsByPathAsArray(self._config['perPlayerArguments'], self._config['playerPath']) if perPlayerArguments: self._config['playerArgs'].extend(perPlayerArguments) - reactor.callLater(0.1, self._playerClass.run, self, self._config['playerPath'], self._config['file'], self._config['playerArgs'], ) + filePath = self._config['file'] + if self._config['sharedPlaylistEnabled'] and filePath is not None: + self.delayedLoadPath = filePath + filePath = "" + reactor.callLater(0.1, self._playerClass.run, self, self._config['playerPath'], filePath, self._config['playerArgs'], ) self._playerClass = None self.protocolFactory = SyncClientFactory(self) if '[' in host: @@ -1541,6 +1546,9 @@ class UiManager(object): self.lastAlertOSDEndTime = None self.lastError = "" + def addFileToPlaylist(self, newPlaylistItem): + self.__ui.addFileToPlaylist(newPlaylistItem) + def setPlaylist(self, newPlaylist, newIndexFilename=None): self.__ui.setPlaylist(newPlaylist, newIndexFilename) @@ -1653,6 +1661,20 @@ class SyncplayPlaylist(): def openedFile(self): self._lastPlaylistIndexChange = time.time() + def removeDirsFromPath(self, filePath): + if os.path.isfile(filePath): + return os.path.basename(filePath) + elif utils.isURL(filePath): + return filePath + self._ui.showDebugMessage("Could not find path: {}".format(filePath)) + + def getPlaylistIndexFromPath(self, filePath): + filePath = self.removeDirsFromPath(filePath) + try: + return self._playlist.index(filePath) + except ValueError: + return + def changeToPlaylistIndexFromFilename(self, filename): try: index = self._playlist.index(filename) @@ -1665,7 +1687,41 @@ class SyncplayPlaylist(): except ValueError: pass + def loadDelayedPath(self, changeToIndex): + # Implementing the behaviour set out at https://github.com/Syncplay/syncplay/issues/315 + if self._client._protocol.hadFirstPlaylistIndex and self._client.delayedLoadPath: + delayedLoadPath = str(self._client.delayedLoadPath) + self._client.delayedLoadPath = None + if self._client.sharedPlaylistIsEnabled(): + pathWithoutDirs = self.removeDirsFromPath(delayedLoadPath) + if len(self._playlist) == 0: + self._client.openFile(delayedLoadPath, resetPosition=True, fromUser=True) + self._client.ui.addFileToPlaylist(delayedLoadPath) + else: + try: + currentPlaylistFilename = self._playlist[changeToIndex] + except TypeError: + currentPlaylistFilename = None + if currentPlaylistFilename != pathWithoutDirs: + if pathWithoutDirs not in self._playlist: + if utils.isURL(delayedLoadPath) or utils.isURL(currentPlaylistFilename): + self._client.ui.addFileToPlaylist(delayedLoadPath) + else: + foundFilePath = self._client.fileSwitch.findFilepath(currentPlaylistFilename, highPriority=True) + if foundFilePath is None: + self._client.openFile(delayedLoadPath, resetPosition=False) + else: + self._client.ui.showMessage("{}: {}...".format(getMessage("addfilestoplaylist-menu-label"), pathWithoutDirs)) + reactor.callLater(constants.DELAYED_LOAD_WAIT_TIME, self._client.ui.addFileToPlaylist, delayedLoadPath, ) # TODO: Avoid arbitary pause + else: + self._client.ui.showErrorMessage(getMessage("cannot-add-duplicate-error").format(pathWithoutDirs)) + + else: + self._client.openFile(delayedLoadPath) + def changeToPlaylistIndex(self, index, username=None, resetPosition=False): + if self.loadDelayedPath(index): + return if self._playlist is None or len(self._playlist) == 0: return if index is None: diff --git a/syncplay/constants.py b/syncplay/constants.py index a40e9ac..7e5d355 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -58,6 +58,7 @@ SHOW_DURATION_NOTIFICATION = True DEBUG_MODE = False # Changing these might be ok +DELAYED_LOAD_WAIT_TIME = 2.5 AUTOMATIC_UPDATE_CHECK_FREQUENCY = 7 * 86400 # Days converted into seconds DEFAULT_REWIND_THRESHOLD = 4 MINIMUM_REWIND_THRESHOLD = 3 diff --git a/syncplay/ui/consoleUI.py b/syncplay/ui/consoleUI.py index 3063ff3..a7d2a4c 100755 --- a/syncplay/ui/consoleUI.py +++ b/syncplay/ui/consoleUI.py @@ -22,6 +22,9 @@ class ConsoleUI(threading.Thread): def addClient(self, client): self._syncplayClient = client + def addFileToPlaylist(self): + pass + def drop(self): pass From 62a036750f8beb28b2509fc1346b0ae1696640cf Mon Sep 17 00:00:00 2001 From: et0h Date: Mon, 25 May 2020 11:15:57 +0100 Subject: [PATCH 081/112] Reduce disruption when changing room (#315) --- syncplay/protocols.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/syncplay/protocols.py b/syncplay/protocols.py index aef41da..7e780a5 100755 --- a/syncplay/protocols.py +++ b/syncplay/protocols.py @@ -206,6 +206,8 @@ class SyncClientProtocol(JSONCommandProtocol): def sendRoomSetting(self, roomName, password=None): setting = {} + self.hadFirstStateUpdate = False + self.hadFirstPlaylistIndex = False setting["name"] = roomName if password: setting["password"] = password From c0df272e41a81765822551fd32f3cd28323bf385 Mon Sep 17 00:00:00 2001 From: et0h Date: Mon, 25 May 2020 11:16:51 +0100 Subject: [PATCH 082/112] Upver to release 85 --- syncplay/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/__init__.py b/syncplay/__init__.py index da83232..1e4b167 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ version = '1.6.5' revision = ' development' milestone = 'Yoitsu' -release_number = '84' +release_number = '85' projectURL = 'https://syncplay.pl/' From e736ba5a46cfbc6f7bfa2cde48f65d890989fcd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wr=C3=B3bel?= Date: Mon, 25 May 2020 19:39:18 +0200 Subject: [PATCH 083/112] Add python 3.8 to setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 358e9ee..2ddc616 100644 --- a/setup.py +++ b/setup.py @@ -61,6 +61,7 @@ setuptools.setup( "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Topic :: Internet", "Topic :: Multimedia :: Video" ], From 9d2f9c9f022167557dfc6e5ea43ce6e604e2613a Mon Sep 17 00:00:00 2001 From: daniel-123 Date: Mon, 25 May 2020 23:26:16 +0200 Subject: [PATCH 084/112] Revert part of the changes from #249 which resulted in missing icons in context menus. --- GNUmakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GNUmakefile b/GNUmakefile index 26e75a3..9400be5 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -43,10 +43,12 @@ common: cp -r syncplay/resources/*.png $(LIB_PATH)/syncplay/syncplay/resources/ cp -r syncplay/resources/*.lua $(LIB_PATH)/syncplay/syncplay/resources/ cp -r syncplay/resources/lua/intf/*.lua $(LIB_PATH)/syncplay/syncplay/resources/lua/intf/ + cp syncplay/resources/hicolor/128x128/apps/syncplay.png $(SHARE_PATH)/pixmaps/ u-common: -rm -rf $(LIB_PATH)/syncplay -rm $(SHARE_PATH)/icons/hicolor/*/apps/syncplay.png + -rm $(SHARE_PATH)/pixmaps/syncplay.png client: -mkdir -p $(BIN_PATH) From 66e628eb89401628ce029b062d0f272ced5deb3d Mon Sep 17 00:00:00 2001 From: daniel-123 Date: Mon, 25 May 2020 23:34:04 +0200 Subject: [PATCH 085/112] Create pixmaps folder if it doesn't exist --- GNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/GNUmakefile b/GNUmakefile index 9400be5..9ac836f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -37,6 +37,7 @@ endif common: -mkdir -p $(LIB_PATH)/syncplay/syncplay/resources/lua/intf -mkdir -p $(APP_SHORTCUT_PATH) + -mkdir -p $(SHARE_PATH)/pixmaps/ cp -r syncplay $(LIB_PATH)/syncplay/ chmod 755 $(LIB_PATH)/syncplay/ cp -r syncplay/resources/hicolor $(SHARE_PATH)/icons/ From 89ce72d6cbbeebc195e1058acc9d26219af0ad75 Mon Sep 17 00:00:00 2001 From: Etoh Date: Wed, 27 May 2020 18:33:07 +0100 Subject: [PATCH 086/112] mpv: Preserve playback state when opening/closing a file --- syncplay/players/mpv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index cc22d84..0dd78fd 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -429,12 +429,12 @@ class MpvPlayer(BasePlayer): paused_update = update_string[2] position_update = update_string[4] if paused_update == "nil": - self._storePauseState(True) + self._storePauseState(float(self._client.getGlobalPaused())) else: self._storePauseState(bool(paused_update == 'true')) self._pausedAsk.set() if position_update == "nil": - self._storePosition(float(0)) + self._storePosition(float(self._client.getGlobalPosition())) else: self._storePosition(float(position_update)) self._positionAsk.set() From 692143b0a1e6db08e59a96cb6e3d82bdfae8e800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wr=C3=B3bel?= Date: Mon, 1 Jun 2020 19:45:07 +0200 Subject: [PATCH 087/112] Lower pyside2 requirement as 5.11 also works. This fixes compatibility issues with Debian Buster and Ubuntu Eoan. --- requirements_gui.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_gui.txt b/requirements_gui.txt index 5eaed0f..a51f665 100644 --- a/requirements_gui.txt +++ b/requirements_gui.txt @@ -1,2 +1,2 @@ -pyside2>=5.12.0 +pyside2>=5.11.0 requests>=2.20.0; sys_platform == 'darwin' From d4ac4556241ae8438b5409c5048edda5e5183638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wr=C3=B3bel?= Date: Mon, 1 Jun 2020 22:41:53 +0200 Subject: [PATCH 088/112] Add deb package to Travis CI (#318) * Script for building deb package on Travis * Adding deb build to Travis CI configuration * Remove superflous install step from deb build * Add permissions to execute build script for deb package. * Update deb build environment to use Ubuntu 18.04 * Install the deb package as part of build process * Fix deb location for installation test * Remove installation test Latest Ubuntu available on Travis doesn't meet minimum required version of pyside2. * Fix pyside dependencies to make them more accurate. * Switch deb build to Ubuntu 20.04 * Add installation and runtime test. * Fix location of deb package for upload to bintray. * Separate out testing from build script. * Make the script output visible in Travis CI logs. * Fix permissons for test script. --- .travis.yml | 9 +++++++++ travis/deb-installation-test.sh | 8 ++++++++ travis/deb-script.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100755 travis/deb-installation-test.sh create mode 100755 travis/deb-script.sh diff --git a/.travis.yml b/.travis.yml index 13e3617..98a03bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,10 @@ jobs: dist: xenial os: linux env: BUILD_DESTINATION=snapcraft + - language: minimal + dist: focal + os: linux + env: BUILD_DESTINATION=deb - language: python os: linux dist: xenial @@ -21,12 +25,16 @@ script: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then python3 buildPy2app.py py2app ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "snapcraft" ]; then sudo snapcraft cleanbuild ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "appimage" ]; then travis/appimage-script.sh ; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "deb" ]; then travis/deb-script.sh ; fi install: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis/macos-install.sh ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "snapcraft" ]; then travis/snapcraft-install.sh ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "appimage" ]; then sudo apt-get install libxkbcommon-x11-0 ; fi +after_success: +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "deb" ]; then travis/deb-installation-test.sh ; fi + before_deploy: - ls -al - export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')" @@ -35,6 +43,7 @@ before_deploy: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis/macos-deploy.sh ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "snapcraft" ]; then mv syncplay_build_amd64.snap dist_bintray/syncplay_${VER}_amd64.snap ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "appimage" ]; then travis/appimage-deploy.sh ; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "deb" ]; then mv /tmp/syncplay.deb dist_bintray/syncplay_${VER}.deb ; fi deploy: skip_cleanup: true diff --git a/travis/deb-installation-test.sh b/travis/deb-installation-test.sh new file mode 100755 index 0000000..b438b56 --- /dev/null +++ b/travis/deb-installation-test.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -x +set -e + +sudo apt install /tmp/syncplay.deb -y +syncplay --no-gui +sudo apt remove syncplay diff --git a/travis/deb-script.sh b/travis/deb-script.sh new file mode 100755 index 0000000..8853d82 --- /dev/null +++ b/travis/deb-script.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +set -x +set -e + +mkdir -p /tmp/syncplay/DEBIAN + +echo "Package: syncplay +Version: "$(sed -n -e "s/^.*version = //p" syncplay/__init__.py | sed "s/'//g")""$(git describe --exact-match --tags HEAD &>/dev/null && echo -git-$(date -u +%y%m%d%H%M))" +Architecture: all +Maintainer: +Depends: python3 (>= 3.4), python3-pyside2.qtwidgets, python3-pyside2.qtcore, python3-twisted (>= 16.4.0), python3-certifi, mpv (>= 0.23) | vlc (>= 2.2.1) +Homepage: https://syncplay.pl +Section: web +Priority: optional +Description: Solution to synchronize video playback across multiple instances of mpv, VLC, MPC-HC and MPC-BE over the Internet. + Syncplay synchronises the position and play state of multiple media players so that the viewers can watch the same thing at the same time. This means that when one person pauses/unpauses playback or seeks (jumps position) within their media player then this will be replicated across all media players connected to the same server and in the same 'room' (viewing session). When a new person joins they will also be synchronised. Syncplay also includes text-based chat so you can discuss a video as you watch it (or you could use third-party Voice over IP software to talk over a video)." \ +> /tmp/syncplay/DEBIAN/control +echo "#!/bin/sh +py3clean -p syncplay +" +> /tmp/syncplay/DEBIAN/prerm +chmod 555 /tmp/syncplay/DEBIAN/prerm + +make install DESTDIR=/tmp/syncplay +dpkg -b /tmp/syncplay/ + From 9484e1042fdff9542528a91e56f85a0f84d52fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wr=C3=B3bel?= Date: Sun, 7 Jun 2020 18:32:40 +0200 Subject: [PATCH 089/112] Exclude pyside2 5.15 from requirements. This should hopefully prevent #321 from occurring in automatically built packages. This is a temporary measure that should be reversed when pyside2 5.15.1 is released as it should include fix for the problem. --- requirements_gui.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_gui.txt b/requirements_gui.txt index a51f665..0594ce5 100644 --- a/requirements_gui.txt +++ b/requirements_gui.txt @@ -1,2 +1,2 @@ -pyside2>=5.11.0 +pyside2>=5.11.0,<5.15 requests>=2.20.0; sys_platform == 'darwin' From 7c9bd596b5ac6fc988ad795cd021216942ad7140 Mon Sep 17 00:00:00 2001 From: ChiyoOsaka Date: Wed, 10 Jun 2020 23:13:06 +0100 Subject: [PATCH 090/112] fix typo in error message (#323) --- syncplay/players/mpv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index 0dd78fd..83ab65a 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -667,7 +667,7 @@ class MpvPlayer(BasePlayer): self.sendQueue.remove(self.sendQueue[itemID]) except UnicodeWarning: self.__playerController._client.ui.showDebugMessage( - " Unicode mismatch occured when trying to remove duplicate") + " Unicode mismatch occurred when trying to remove duplicate") # TODO: Prevent this from being triggered pass break From a1a5d7bc3cf5d1a6f3ad90f43b93123271dd80cb Mon Sep 17 00:00:00 2001 From: Artur Quaresma Date: Thu, 18 Jun 2020 21:17:25 +0100 Subject: [PATCH 091/112] Corrected some not translated on pt-BR and added pt-PT (#317) * Solved some errors on translation * more error on translation founded * Full portuguese from Portugal translation. Since its the original country, I decided to change words. The way that Brazil writes its very different from Portugal --- buildPy2exe.py | 17 ++ requirements_gui.txt | 2 +- syncplay/messages.py | 4 +- syncplay/messages_de.py | 2 +- syncplay/messages_en.py | 2 +- syncplay/messages_es.py | 2 +- syncplay/messages_it.py | 2 +- syncplay/messages_pt_BR.py | 8 +- syncplay/messages_pt_PT.py | 508 +++++++++++++++++++++++++++++++++++++ syncplay/messages_ru.py | 2 +- 10 files changed, 538 insertions(+), 11 deletions(-) create mode 100644 syncplay/messages_pt_PT.py diff --git a/buildPy2exe.py b/buildPy2exe.py index 78bb5d6..94c8ea9 100755 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -64,6 +64,7 @@ NSIS_SCRIPT_TEMPLATE = r""" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Italian.nlf" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Spanish.nlf" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\PortugueseBR.nlf" + LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Portuguese.nlf" Unicode true @@ -107,6 +108,11 @@ NSIS_SCRIPT_TEMPLATE = r""" VIAddVersionKey /LANG=$${LANG_PORTUGUESEBR} "LegalCopyright" "Syncplay" VIAddVersionKey /LANG=$${LANG_PORTUGUESEBR} "FileDescription" "Syncplay" + VIAddVersionKey /LANG=$${LANG_PORTUGUESE} "ProductName" "Syncplay" + VIAddVersionKey /LANG=$${LANG_PORTUGUESE} "FileVersion" "$version.0" + VIAddVersionKey /LANG=$${LANG_PORTUGUESE} "LegalCopyright" "Syncplay" + VIAddVersionKey /LANG=$${LANG_PORTUGUESE} "FileDescription" "Syncplay" + LangString ^SyncplayLanguage $${LANG_ENGLISH} "en" LangString ^Associate $${LANG_ENGLISH} "Associate Syncplay with multimedia files." LangString ^Shortcut $${LANG_ENGLISH} "Create Shortcuts in following locations:" @@ -169,6 +175,15 @@ NSIS_SCRIPT_TEMPLATE = r""" LangString ^AutomaticUpdates $${LANG_PORTUGUESEBR} "Verificar atualizações automaticamente" LangString ^UninstConfig $${LANG_PORTUGUESEBR} "Deletar arquivo de configuração." + LangString ^SyncplayLanguage $${LANG_PORTUGUESE} "pt_PT" + LangString ^Associate $${LANG_PORTUGUESE} "Associar Syncplay aos ficheiros multimédia." + LangString ^Shortcut $${LANG_PORTUGUESE} "Criar atalhos nos seguintes locais:" + LangString ^StartMenu $${LANG_PORTUGUESE} "Menu Iniciar" + LangString ^Desktop $${LANG_PORTUGUESE} "Área de trabalho" + LangString ^QuickLaunchBar $${LANG_PORTUGUESE} "Barra de acesso rápido" + LangString ^AutomaticUpdates $${LANG_PORTUGUESE} "Verificar atualizações automaticamente" + LangString ^UninstConfig $${LANG_PORTUGUESE} "Apagar ficheiro de configuração." + ; Remove text to save space LangString ^ClickInstall $${LANG_GERMAN} " " @@ -276,6 +291,8 @@ NSIS_SCRIPT_TEMPLATE = r""" Push Español Push $${LANG_PORTUGUESEBR} Push 'Português do Brasil' + Push $${LANG_PORTUGUESE} + Push 'Português de Portugal' Push A ; A means auto count languages LangDLL::LangDialog "Language Selection" "Please select the language of Syncplay and the installer" Pop $$LANGUAGE diff --git a/requirements_gui.txt b/requirements_gui.txt index 0594ce5..cbdd00c 100644 --- a/requirements_gui.txt +++ b/requirements_gui.txt @@ -1,2 +1,2 @@ pyside2>=5.11.0,<5.15 -requests>=2.20.0; sys_platform == 'darwin' +requests>=2.20.0; sys_platform == 'darwin' \ No newline at end of file diff --git a/syncplay/messages.py b/syncplay/messages.py index a5e9b24..b5a88b7 100755 --- a/syncplay/messages.py +++ b/syncplay/messages.py @@ -7,6 +7,7 @@ from . import messages_de from . import messages_it from . import messages_es from . import messages_pt_BR +from . import messages_pt_PT messages = { "en": messages_en.en, @@ -14,7 +15,8 @@ messages = { "de": messages_de.de, "it": messages_it.it, "es": messages_es.es, - "es": messages_pt_BR.pt_BR, + "pt_BR": messages_pt_BR.pt_BR, + "pt_PT": messages_pt_PT.pt_PT, "CURRENT": None } diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 13331a0..fea05f3 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -169,7 +169,7 @@ de = { "file-argument": 'Abzuspielende Datei', "args-argument": 'Player-Einstellungen; Wenn du Einstellungen, die mit - beginnen, nutzen willst, stelle ein einzelnes \'--\'-Argument davor', "clear-gui-data-argument": 'Setzt die Pfad- und GUI-Fenster-Daten die in den QSettings gespeichert sind zurück', - "language-argument": 'Sprache für Syncplay-Nachrichten (de/en/ru/it/es/pt_BR)', + "language-argument": 'Sprache für Syncplay-Nachrichten (de/en/ru/it/es/pt_BR/pt_PT)', "version-argument": 'gibt die aktuelle Version aus', "version-message": "Du verwendest Syncplay v. {} ({})", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 9576967..548f42a 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -169,7 +169,7 @@ en = { "file-argument": 'file to play', "args-argument": 'player options, if you need to pass options starting with - prepend them with single \'--\' argument', "clear-gui-data-argument": 'resets path and window state GUI data stored as QSettings', - "language-argument": 'language for Syncplay messages (de/en/ru/it/es/pt_BR)', + "language-argument": 'language for Syncplay messages (de/en/ru/it/es/pt_BR/pt_PT)', "version-argument": 'prints your version', "version-message": "You're using Syncplay version {} ({})", diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index 4cfca73..edd2878 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -169,7 +169,7 @@ es = { "file-argument": 'archivo a reproducir', "args-argument": 'opciones del reproductor, si necesitas pasar opciones que empiezan con -, pásalas utilizando \'--\'', "clear-gui-data-argument": 'restablece ruta y los datos del estado de la ventana GUI almacenados como QSettings', - "language-argument": 'lenguaje para los mensajes de Syncplay (de/en/ru/it/es/pt_BR)', + "language-argument": 'lenguaje para los mensajes de Syncplay (de/en/ru/it/es/pt_BR/pt_PT)', "version-argument": 'imprime tu versión', "version-message": "Estás usando la versión de Syncplay {} ({})", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 4e0d98c..6eae224 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -169,7 +169,7 @@ it = { "file-argument": 'file da riprodurre', "args-argument": 'opzioni del player, se hai bisogno di utilizzare opzioni che iniziano con - anteponi un singolo \'--\'', "clear-gui-data-argument": 'ripristina il percorso e i dati impostati tramite interfaccia grafica e salvati come QSettings', - "language-argument": 'lingua per i messaggi di Syncplay (de/en/ru/it/es/pt_BR)', + "language-argument": 'lingua per i messaggi di Syncplay (de/en/ru/it/es/pt_BR/pt_PT)', "version-argument": 'mostra la tua versione', "version-message": "Stai usando la versione di Syncplay {} ({})", diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py index a277714..649cd99 100644 --- a/syncplay/messages_pt_BR.py +++ b/syncplay/messages_pt_BR.py @@ -106,7 +106,7 @@ pt_BR = { "mpc-slave-error": "Não foi possível abrir o MPC no slave mode!", "mpc-version-insufficient-error": "A versão do MPC é muito antiga, por favor use `mpc-hc` >= `{}`", "mpc-be-version-insufficient-error": "A versão do MPC-BE é muito antiga, por favor use `mpc-be` >= `{}`", - "mpv-version-error": "O Syncplay não é compatível com esta versão do mpv. Por favor, use uma versão diferente do mpv (por exemplo, Git HEAD).", + "mpv-version-error": "O motivo pelo qual o mpv não pode ser iniciado pode ser devido ao uso de argumentos da linha de comando não suportados ou a uma versão não suportada do mpv.", "mpv-failed-advice": "The reason mpv cannot start may be due to the use of unsupported command line arguments or an unsupported version of mpv.", # TODO: Translate "player-file-open-error": "O reprodutor falhou ao abrir o arquivo", "player-path-error": "O caminho até o arquivo executável do reprodutor não está configurado corretamente. Os reprodutores suportados são: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2", @@ -126,8 +126,8 @@ pt_BR = { "invalid-port-config-error": "A porta deve ser válida", "empty-value-config-error": "{} não pode ser vazio", # Config option - "not-json-error": "Não é uma string codificada como json\n", - "hello-arguments-error": "Not enough Hello arguments\n", # DO NOT TRANSLATE + "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 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-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.", @@ -169,7 +169,7 @@ pt_BR = { "file-argument": 'arquivo a ser tocado', "args-argument": 'opções do reprodutor; se você precisar passar opções começando com -, as preceda com um único argumento \'--\'', "clear-gui-data-argument": 'redefine o caminho e o estado de dados da janela da GUI para as de QSettings', - "language-argument": 'idioma para mensagens do Syncplay (de/en/ru/it/es/pt_BR)', + "language-argument": 'idioma para mensagens do Syncplay (de/en/ru/it/es/pt_BR/pt_PT)', "version-argument": 'exibe sua versão', "version-message": "Você está usando o Syncplay versão {} ({})", diff --git a/syncplay/messages_pt_PT.py b/syncplay/messages_pt_PT.py new file mode 100644 index 0000000..5c4e10a --- /dev/null +++ b/syncplay/messages_pt_PT.py @@ -0,0 +1,508 @@ +# coding:utf8 + +"""Portugal Portuguese dictionary""" + +pt_PT = { + "LANGUAGE": "Português de Portugal", + + # Client notifications + "config-cleared-notification": "Configurações removidas. As mudanças serão salvas quando você armazenar uma configuração válida.", + + "relative-config-notification": "Ficheiro(s) de configuração relativa carregado(s): {}", + + "connection-attempt-notification": "Tentando se conectar a {}:{}", # Port, IP + "reconnection-attempt-notification": "Conexão com o servidor perdida, tentando reconectar", + "disconnection-notification": "Desconectado do servidor", + "connection-failed-notification": "Conexão com o servidor falhou", + "connected-successful-notification": "Conectado com sucesso ao servidor", + "retrying-notification": "%s, tentando novamente em %d segundos...", # Seconds + "reachout-successful-notification": "Alcançado {} ({}) com sucesso", + + "rewind-notification": "Retrocedendo devido à diferença de tempo com {}", # User + "fastforward-notification": "Avançando devido à diferença de tempo com {}", # User + "slowdown-notification": "Diminuindo a velocidade devido à diferença de tempo com {}", # User + "revert-notification": "Revertendo velocidade ao normal", + + "pause-notification": "{} pausou", # User + "unpause-notification": "{} despausou", # User + "seek-notification": "{} saltou de {} para {}", # User, from time, to time + + "current-offset-notification": "Deslocamento atual: {} segundos", # Offset + + "media-directory-list-updated-notification": "Os pastas de mídia do Syncplay foram atualizados.", + + "room-join-notification": "{} entrou na sala: '{}'", # User + "left-notification": "{} saiu da sala", # User + "left-paused-notification": "{} saiu da sala, {} pausou", # User who left, User who paused + "playing-notification": "{} está reproduzinho '{}' ({})", # User, file, duration + "playing-notification/room-addendum": " na sala: '{}'", # Room + + "not-all-ready": "Não está pronto: {}", # Usernames + "all-users-ready": "Todos utilizadores estão prontos ({} users)", # Number of ready users + "ready-to-unpause-notification": "Agora você está definido como pronto - despause novamente para despausar", + "set-as-ready-notification": "Agora você está definido como pronto", + "set-as-not-ready-notification": "Agora você está definido como não pronto", + "autoplaying-notification": "Reprodução automática em {}...", # Number of seconds until playback will start + + "identifying-as-controller-notification": "Identificando-se como administrador da sala com a senha '{}'...", + "failed-to-identify-as-controller-notification": "{} falhou ao se identificar como administrador da sala.", + "authenticated-as-controller-notification": "{} autenticou-se como um administrador da sala", + "created-controlled-room-notification": "Criou a sala controlada '{}' com a senha '{}'. Por favor, guarda essa informação para futura referência!\n\nIn managed rooms everyone is kept in sync with the room operator(s) who are the only ones who can pause, unpause, seek, and change the playlist.\n\nYou should ask regular viewers to join the room '{}' but the room operators can join the room '{}' to automatically authenticate themselves.", # RoomName, operatorPassword, roomName, roomName:operatorPassword # TODO: Translate + + "file-different-notification": "O ficheiro que você está tocando parece ser diferente do ficheiro de {}", # User + "file-differences-notification": "Seus ficheiros se diferem da(s) seguinte(s) forma(s): {}", # Differences + "room-file-differences": "Diferenças de ficheiros: {}", # File differences (filename, size, and/or duration) + "file-difference-filename": "nome", + "file-difference-filesize": "tamanho", + "file-difference-duration": "duração", + "alone-in-the-room": "Você está sozinho na sala", + + "different-filesize-notification": " (o tamanho do ficheiro deles é diferente do seu!)", + "userlist-playing-notification": "{} está tocando:", # Username + "file-played-by-notification": "Ficheiro: {} está sendo reproduzido por:", # File + "no-file-played-notification": "{} não está reproduzinho um ficheiro", # Username + "notplaying-notification": "Pessoas que não estão reproduzinho nenhum ficheiro:", + "userlist-room-notification": "Na sala '{}':", # Room + "userlist-file-notification": "Ficheiro", + "controller-userlist-userflag": "Administrador", + "ready-userlist-userflag": "Pronto", + + "update-check-failed-notification": "Não foi possível verificar automaticamente se o Syncplay {} é a versão mais recente. Deseja visitar https://syncplay.pl/ para verificar manualmente por atualizações?", # Syncplay version + "syncplay-uptodate-notification": "O Syncplay está atualizado", + "syncplay-updateavailable-notification": "Uma nova versão do Syncplay está disponível. Deseja visitar a página de lançamentos?", + + "mplayer-file-required-notification": "Syncplay com mplayer requer que você forneça o ficheiro ao começar", + "mplayer-file-required-notification/example": "Exemplo de uso: syncplay [opções] [url|caminho_ate_o_ficheiro/]nome_do_ficheiro", + "mplayer2-required": "O Syncplay é incompatível com o MPlayer 1.x, por favor use mplayer2 ou mpv", + + "unrecognized-command-notification": "Comando não reconhecido", + "commandlist-notification": "Comandos disponíveis:", + "commandlist-notification/room": "\tr [nome] - muda de sala", + "commandlist-notification/list": "\tl - mostra lista de utilizadores", + "commandlist-notification/undo": "\tu - desfaz último salto", + "commandlist-notification/pause": "\tp - alterna pausa", + "commandlist-notification/seek": "\t[s][+-]time - salta para o valor de tempo dado, se + ou - não forem especificados, será o tempo absoluto em segundos ou minutos:segundos", + "commandlist-notification/help": "\th - esta mensagem de ajuda", + "commandlist-notification/toggle": "\tt - alterna o seu status de prontidão para assistir", + "commandlist-notification/create": "\tc [nome] - cria sala gerenciada usando o nome da sala atual", + "commandlist-notification/auth": "\ta [senha] - autentica-se como administrador da sala com a senha", + "commandlist-notification/chat": "\tch [mensagem] - envia uma mensagem no chat da sala", + "syncplay-version-notification": "Versão do Syncplay: {}", # syncplay.version + "more-info-notification": "Mais informações disponíveis em: {}", # projectURL + + "gui-data-cleared-notification": "O Syncplay limpou o caminho e o estado de dados da janela usados pela GUI.", + "language-changed-msgbox-label": "O idioma será alterado quando você salvar as alterações e reabrir o Syncplay.", + "promptforupdate-label": "O Syncplay pode verificar automaticamente por atualizações de tempos em tempos?", + + "media-player-latency-warning": "Aviso: O reprodutor de mídia demorou {} para responder. Se você tiver problemas de sincronização, desligue outros programas para libertar recursos do sistema e, se isso não funcionar, tente outro reprodutor de mídia.", # Seconds to respond + "mpv-unresponsive-error": "O mpv não respondeu por {} segundos, portanto parece que não está funcionando. Por favor, reinicie o Syncplay.", # Seconds to respond + + # Client prompts + "enter-to-exit-prompt": "Aperte Enter para sair\n", + + # Client errors + "missing-arguments-error": "Alguns argumentos necessários estão faltando, por favor reveja --help", + "server-timeout-error": "A conexão com o servidor ultrapassou o tempo limite", + "mpc-slave-error": "Não foi possível abrir o MPC no slave mode!", + "mpc-version-insufficient-error": "A versão do MPC é muito antiga, por favor use `mpc-hc` >= `{}`", + "mpc-be-version-insufficient-error": "A versão do MPC-BE é muito antiga, por favor use `mpc-be` >= `{}`", + "mpv-version-error": "O Syncplay não é compatível com esta versão do mpv. Por favor, use uma versão diferente do mpv (por exemplo, Git HEAD).", + "mpv-failed-advice": "O motivo pelo qual o mpv não pode ser iniciado pode ser devido ao uso de argumentos da linha de comando não suportados ou a uma versão não suportada do mpv.", # TODO: Translate + "player-file-open-error": "O reprodutor falhou ao abrir o ficheiro", + "player-path-error": "O caminho até o ficheiro executável do reprodutor não está configurado corretamente. Os reprodutores suportados são: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2", + "hostname-empty-error": "O endereço do servidor não pode ser vazio", + "empty-error": "{} não pode ser vazio", # Configuration + "media-player-error": "Erro do reprodutor de mídia: \"{}\"", # Error line + "unable-import-gui-error": "Não foi possível importar bibliotecas da GUI. Se você não possuir o PySide instalado, instale-o para que a GUI funcione.", + "unable-import-twisted-error": "Não foi possível importar o Twisted. Por favor, instale o Twisted v16.4.0 ou superior.", + + "arguments-missing-error": "Alguns argumentos necessários estão faltando, por favor reveja --help", + + "unable-to-start-client-error": "Não foi possível iniciar o client", + + "player-path-config-error": "O caminho até o ficheiro executável do reprodutor não está configurado corretamente. Os reprodutores suportados são: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2.", + "no-file-path-config-error": "O ficheiro deve ser selecionado antes de iniciar seu reprodutor", + "no-hostname-config-error": "O endereço do servidor não pode ser vazio", + "invalid-port-config-error": "A porta deve ser válida", + "empty-value-config-error": "{} não pode ser vazio", # Config option + + "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-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.", + + "feature-sharedPlaylists": "playlists compartilhadas", # used for not-supported-by-server-error + "feature-chat": "chat", # used for not-supported-by-server-error + "feature-readiness": "prontidão", # used for not-supported-by-server-error + "feature-managedRooms": "salas administradas", # used for not-supported-by-server-error + + "not-supported-by-server-error": "O recurso {} não é suportado por este servidor.", # feature + "shared-playlists-not-supported-by-server-error": "O recurso de playlists compartilhadas pode não ser suportado por este servidor. Para garantir que funcione corretamente, é necessário um servidor a correr Syncplay {} ou superior, mas este está correndoo Syncplay {}.", # minVersion, serverVersion + "shared-playlists-disabled-by-server-error": "O recurso de playlists compartilhadas foi desativado nas configurações do servidor. Para usar este recurso, você precisa se conectar a um servidor diferente.", + + "invalid-seek-value": "Valor de salto inválido", + "invalid-offset-value": "Valor de deslocamento inválido", + + "switch-file-not-found-error": "Não foi possível mudar para o ficheiro '{0}'. O Syncplay procura nos pastas de mídia especificados.", # File not found + "folder-search-timeout-error": "A busca por mídias no pasta de mídias foi cancelada pois demorou muito tempo para procurar em '{}'. Isso ocorre quando você seleciona uma pasta com muitas subpastas em sua lista de pastas de mídias a serem pesquisadas. Para que a troca automática de ficheiros funcione novamente, selecione 'Ficheiro -> Definir pastas de mídias' na barra de menus e remova esse pasta ou substitua-o por uma subpasta apropriada. Se a pasta não tiver problemas, é possível reativá-la selecionando 'Ficheiro -> Definir pastas de mídias' e pressionando 'OK'.", # Folder + "folder-search-first-file-timeout-error": "A busca por mídias em '{}' foi interrompida, pois demorou muito para acessar o pasta. Isso pode acontecer se for uma unidade de rede ou se você configurar o seu dispositivo para hibernar depois de um período de inatividade. Para que a troca automática de ficheiros funcione novamente, vá para 'Ficheiro -> Definir pastas de mídias' e remova o pasta ou resolva o problema (por exemplo, alterando as configurações de economia de energia da unidade).", # Folder + "added-file-not-in-media-directory-error": "Você carregou um ficheiro em '{}', que não é um pasta de mídias conhecido. Você pode adicioná-lo isso como um pasta de mídia selecionando 'Ficheiro -> Definir pastas de mídias' na barra de menus.", # Folder + "no-media-directories-error": "Nenhum pasta de mídias foi definido. Para que os recursos de playlists compartilhadas e troca automática de ficheiros funcionem corretamente, selecione 'Ficheiro -> Definir pastas de mídias' e especifique onde o Syncplay deve procurar para encontrar ficheiros de mídia.", + "cannot-find-directory-error": "Não foi possível encontrar o pasta de mídia '{}'. Para atualizar sua lista de pastas de mídias, selecione 'Ficheiro -> Definir pastas de mídias' na barra de menus e especifique onde o Syncplay deve procurar para encontrar ficheiros de mídia.", + + "failed-to-load-server-list-error": "Não foi possível carregar a lista de servidores públicos. Por favor, visite https://www.syncplay.pl/ em seu navegador.", + + # Client arguments + "argument-description": 'Solução para sincronizar reprodução de múltiplas instâncias de reprodutores de mídia pela rede.', + "argument-epilog": 'Se nenhuma opção for fornecida, os valores de _config serão usados', + "nogui-argument": 'não mostrar GUI', + "host-argument": 'endereço do servidor', + "name-argument": 'nome de utilizador desejado', + "debug-argument": 'modo depuração', + "force-gui-prompt-argument": 'fazer o prompt de configuração aparecer', + "no-store-argument": 'não guardar valores em .syncplay', + "room-argument": 'sala padrão', + "password-argument": 'senha do servidor', + "player-path-argument": 'caminho até o executável do reprodutor de mídia', + "file-argument": 'ficheiro a ser tocado', + "args-argument": 'opções do reprodutor; se você precisar passar opções começando com -, as preceda com um único argumento \'--\'', + "clear-gui-data-argument": 'redefine o caminho e o estado de dados da janela da GUI para as de QSettings', + "language-argument": 'idioma para mensagens do Syncplay (de/en/ru/it/es/pt_BR/pt_PT)', + + "version-argument": 'exibe sua versão', + "version-message": "Você está usando o Syncplay versão {} ({})", + + "load-playlist-from-file-argument": "carrega playlist de um ficheiro de texto (uma entrada por linha)", + + # Client labels + "config-window-title": "Configuração do Syncplay", + + "connection-group-title": "Configurações de conexão", + "host-label": "Endereço do servidor: ", + "name-label": "Nome de utilizador (opcional): ", + "password-label": "Senha do servidor (se existir): ", + "room-label": "Sala padrão: ", + + "media-setting-title": "Configurações do reprodutor de mídia", + "executable-path-label": "Executável do reprodutor:", + "media-path-label": "Ficheiro de vídeo ou URL (opcional):", + "player-arguments-label": "Argumentos para o reprodutor (opcional):", + "browse-label": "Navegar", + "update-server-list-label": "Atualizar lista", + + "more-title": "Mostrar mais configurações", + "never-rewind-value": "Nunca", + "seconds-suffix": " s", + "privacy-sendraw-option": "Enviar bruto", + "privacy-sendhashed-option": "Enviar hasheado", + "privacy-dontsend-option": "Não enviar", + "filename-privacy-label": "Informação do nome do ficheiro:", + "filesize-privacy-label": "Informação do tamanho do ficheiro:", + "checkforupdatesautomatically-label": "Verificar atualizações do Syncplay automaticamente", + "slowondesync-label": "Diminuir velocidade em dessincronizações menores (não suportado pelo MPC-HC/BE)", + "rewindondesync-label": "Retroceder em dessincronização maiores (recomendado)", + "fastforwardondesync-label": "Avançar se estiver ficando para trás (recomendado)", + "dontslowdownwithme-label": "Nunca desacelerar ou retroceder outros (experimental)", + "pausing-title": "Pausando", + "pauseonleave-label": "Pausar quando um utilizador sair (por exemplo, se for desconectado)", + "readiness-title": "Estado de prontidão inicial", + "readyatstart-label": "Marque-me como 'pronto para assistir' por padrão", + "forceguiprompt-label": "Não mostrar sempre a janela de configuração do Syncplay", # (Inverted) + "showosd-label": "Ativar mensagens na tela (OSD)", + + "showosdwarnings-label": "Incluir avisos (por exemplo, quando os ficheiros são diferentes, os utilizador não estão prontos, etc)", + "showsameroomosd-label": "Incluir eventos da sua sala", + "shownoncontrollerosd-label": "Incluir eventos de não administradores em salas administradas", + "showdifferentroomosd-label": "Incluir eventos de outras salas", + "showslowdownosd-label": "Incluir notificações de desaceleramento ou retrocedimento", + "language-label": "Idioma:", + "automatic-language": "Padrão ({})", # Default language + "showdurationnotification-label": "Avisar sobre discrepância nas durações dos arquivos de mídia", + "basics-label": "Básicos", + "readiness-label": "Play/Pause", + "misc-label": "Miscelânea", + "core-behaviour-title": "Comportamento da sala padrão", + "syncplay-internals-title": "Syncplay internals", + "syncplay-mediasearchdirectories-title": "pastas a buscar por mídias", + "syncplay-mediasearchdirectories-label": "pastas a buscar por mídias (um caminho por linha)", + "sync-label": "Sincronizar", + "sync-otherslagging-title": "Se outros estiverem ficando pra trás...", + "sync-youlaggging-title": "Se você estiver ficando pra trás...", + "messages-label": "Mensagens", + "messages-osd-title": "Configurações das mensagens na tela (OSD)", + "messages-other-title": "Outras configurações de tela", + "chat-label": "Chat", + "privacy-label": "Privacidade", # Currently unused, but will be brought back if more space is needed in Misc tab + "privacy-title": "Configurações de privacidade", + "unpause-title": "Se você apertar play, definir-se como pronto e:", + "unpause-ifalreadyready-option": "Despausar se você já estiver definido como pronto", + "unpause-ifothersready-option": "Despausar se você já estiver pronto ou outros na sala estiverem prontos (padrão)", + "unpause-ifminusersready-option": "Despausar se você já estiver pronto ou outros na sala estiverem prontos e o número mínimo de utilizadores está pronto", + "unpause-always": "Sempre despausar", + "syncplay-trusteddomains-title": "Domínios confiáveis (para serviços de streaming e conteúdo hospedado)", + + "chat-title": "Entrada de mensagem do chat", + "chatinputenabled-label": "Habilitar entrada de chat via mpv", + "chatdirectinput-label": "Permitir entrada instantânea de chat (evita ter de apertar Enter para abrir o chat)", + "chatinputfont-label": "Fonte da entrada de chat", + "chatfont-label": "Definir fonte", + "chatcolour-label": "Definir cor", + "chatinputposition-label": "Posição da área de entrada de mensagens no mpv", + "chat-top-option": "Topo", + "chat-middle-option": "Meio", + "chat-bottom-option": "Fundo", + "chatoutputheader-label": "Saída de mensagem do chat", + "chatoutputfont-label": "Fonte da saída de chat", + "chatoutputenabled-label": "Habilitar saída de chat no reprodutor de mídia (apenas mpv por enquanto)", + "chatoutputposition-label": "Modo de saída", + "chat-chatroom-option": "Estilo sala de bate-papo", + "chat-scrolling-option": "Estilo de rolagem", + + "mpv-key-tab-hint": "[TAB] para alternar acesso instantâneo ao chat.", + "mpv-key-hint": "[ENTER] para enviar mensagem. [ESC] para sair do modo de chat.", + "alphakey-mode-warning-first-line": "Você pode usar os antigos atalhos do mpv com as teclas A-Z.", + "alphakey-mode-warning-second-line": "Aperte [TAB] para retornar ao modo de chat instantâneo do Syncplay.", + + "help-label": "Ajuda", + "reset-label": "Restaurar padrões", + "run-label": "Começar Syncplay", + "storeandrun-label": "Salvar mudanças e começar Syncplay", + + "contact-label": "Sinta-se livre para enviar um e-mail para dev@syncplay.pl, conversar via chat pelo canal do IRC #Syncplay no irc.freenode.net, abrir uma issue pelo GitHub, curtir nossa página no Facebook, nos seguir no Twitter ou visitar https://syncplay.pl/. Não use o Syncplay para mandar informações sensíveis/confidenciais.", + + "joinroom-label": "Juntar-se a uma sala", + "joinroom-menu-label": "Juntar-se à sala {}", + "seektime-menu-label": "Saltar para o tempo", + "undoseek-menu-label": "Desfazer salto", + "play-menu-label": "Play", + "pause-menu-label": "Pause", + "playbackbuttons-menu-label": "Mostrar botões de reprodução", + "autoplay-menu-label": "Mostrar botão de reprodução automática", + "autoplay-guipushbuttonlabel": "Tocar quando todos estiverem prontos", + "autoplay-minimum-label": "Mín. de utilizadores:", + + "sendmessage-label": "Enviar", + + "ready-guipushbuttonlabel": "Estou pronto para assistir!", + + "roomuser-heading-label": "Sala / Utilizador", + "size-heading-label": "Tamanho", + "duration-heading-label": "Duração", + "filename-heading-label": "Nome do ficheiro", + "notifications-heading-label": "Notificações", + "userlist-heading-label": "Lista de quem está tocando o quê", + + "browseformedia-label": "Navegar por ficheiros de mídia", + + "file-menu-label": "&Ficheiro", # & precedes shortcut key + "openmedia-menu-label": "A&brir ficheiro de mídia", + "openstreamurl-menu-label": "Abrir &URL de stream de mídia", + "setmediadirectories-menu-label": "Definir &pastas de mídias", + "loadplaylistfromfile-menu-label": "&Carregar playlist de ficheiro", + "saveplaylisttofile-menu-label": "&Salvar playlist em ficheiro", + "exit-menu-label": "&Sair", + "advanced-menu-label": "A&vançado", + "window-menu-label": "&Janela", + "setoffset-menu-label": "Definir &deslocamento", + "createcontrolledroom-menu-label": "&Criar sala administrada", + "identifyascontroller-menu-label": "&Identificar-se como administrador da sala", + "settrusteddomains-menu-label": "D&efinir domínios confiáveis", + "addtrusteddomain-menu-label": "Adicionar {} como domínio confiável", # Domain + + "edit-menu-label": "&Editar", + "cut-menu-label": "Cor&tar", + "copy-menu-label": "&Copiar", + "paste-menu-label": "C&olar", + "selectall-menu-label": "&Selecionar todos", + + "playback-menu-label": "&Reprodução", + + "help-menu-label": "&Ajuda", + "userguide-menu-label": "Abrir &guia de utilizador", + "update-menu-label": "&Verificar atualizações", + + "startTLS-initiated": "Tentando estabelecer conexão segura", + "startTLS-secure-connection-ok": "Conexão segura estabelecida ({})", + "startTLS-server-certificate-invalid": 'Não foi possível estabelecer uma conexão segura. O servidor usa um certificado de segurança inválido. Essa comunicação pode ser interceptada por terceiros. Para mais detalhes de solução de problemas, consulte aqui.', + "startTLS-server-certificate-invalid-DNS-ID": "O Syncplay não confia neste servidor porque usa um certificado que não é válido para o nome do host.", # TODO: Translate + "startTLS-not-supported-client": "Este client não possui suporte para TLS", + "startTLS-not-supported-server": "Este servidor não possui suporte para TLS", + + # TLS certificate dialog + "tls-information-title": "Detalhes do certificado", + "tls-dialog-status-label": "Syncplay está a usar uma conexão criptografada para {}.", + "tls-dialog-desc-label": "A criptografia com um certificado digital mantém as informações em sigilo quando são enviadas para ou do
servidor {}.", + "tls-dialog-connection-label": "Informações criptografadas usando o Transport Layer Security (TLS), versão {} com o conjunto de cifras (cipher suite)
: {}.", + "tls-dialog-certificate-label": "Certificado emitido em {} e válido até {}.", + + # About dialog + "about-menu-label": "&Sobre o Syncplay", + "about-dialog-title": "Sobre o Syncplay", + "about-dialog-release": "Versão {}, lançamento {}", + "about-dialog-license-text": "Licenciado sob a Licença Apache, Versão 2.0", + "about-dialog-license-button": "Licença", + "about-dialog-dependencies": "Dependências", + + "setoffset-msgbox-label": "Definir deslocamento", + "offsetinfo-msgbox-label": "Deslocamento (veja https://syncplay.pl/guide/ para instruções de uso):", + + "promptforstreamurl-msgbox-label": "Abrir transmissão de mídia via URL", + "promptforstreamurlinfo-msgbox-label": "Transmitir URL", + + "addfolder-label": "Adicionar pasta", + + "adduris-msgbox-label": "Adicionar URLs à playlist (uma por linha)", + "editplaylist-msgbox-label": "Definir playlist (uma por linha)", + "trusteddomains-msgbox-label": "Domínios para os quais é permitido trocar automaticamente (um por linha)", + + "createcontrolledroom-msgbox-label": "Criar sala administrativa", + "controlledroominfo-msgbox-label": "Informe o nome da sala administrativa\r\n(veja https://syncplay.pl/guide/ para instruções de uso):", + + "identifyascontroller-msgbox-label": "Identificar-se como administrador da sala", + "identifyinfo-msgbox-label": "Informe a senha de administrador para esta sala\r\n(veja https://syncplay.pl/guide/ para instruções de uso):", + + "public-server-msgbox-label": "Selecione o servidor público para esta sessão de visualização", + + "megabyte-suffix": " MB", + + # Tooltips + + "host-tooltip": "Hostname ou IP para se conectar, opcionalmente incluindo uma porta (por exemplo, syncplay.pl:8999). Só sincroniza-se com utilizadores no mesmo servidor/porta.", + "name-tooltip": "Nome pelo qual você será conhecido. Não há cadastro, então você pode facilmente mudar mais tarde. Se não for especificado, será gerado aleatoriamente.", + "password-tooltip": "Senhas são necessárias apenas para servidores privados.", + "room-tooltip": "O nome da sala para se conectar pode ser praticamente qualquer coisa, mas você só irá se sincronizar com utilizadores na mesma sala.", + + "executable-path-tooltip": "Localização do seu reprodutor de mídia preferido (mpv, mpv.net, VLC, MPC-HC/BE ou mplayer2).", + "media-path-tooltip": "Localização do vídeo ou transmissão a ser aberto. Necessário com o mplayer2.", + "player-arguments-tooltip": "Argumentos de comando de linha adicionais para serem repassados ao reprodutor de mídia.", + "mediasearcdirectories-arguments-tooltip": "Pasta onde o Syncplay vai procurar por ficheiros de mídia, por exemplo quando você estiver usando o recurso de clicar para mudar. O Syncplay irá procurar recursivamente pelas subpastas.", + + "more-tooltip": "Mostrar configurações frequentemente menos utilizadas.", + "filename-privacy-tooltip": "Modo de privacidade para mandar nome de ficheiro do ficheiro atual para o servidor.", + "filesize-privacy-tooltip": "Modo de privacidade para mandar tamanho do ficheiro atual para o servidor.", + "privacy-sendraw-tooltip": "Enviar esta informação sem ofuscação. Esta é a opção padrão com mais funcionalidades.", + "privacy-sendhashed-tooltip": "Mandar versão hasheada da informação, tornando-a menos visível aos outros clients.", + "privacy-dontsend-tooltip": "Não enviar esta informação ao servidor. Esta opção oferece a maior privacidade.", + "checkforupdatesautomatically-tooltip": "Verificar o site do Syncplay regularmente para ver se alguma nova versão do Syncplay está disponível.", + "slowondesync-tooltip": "Reduzir a velocidade de reprodução temporariamente quando necessário para trazer você de volta à sincronia com os outros espectadores. Não suportado pelo MPC-HC/BE.", + "dontslowdownwithme-tooltip": "Significa que outros não serão desacelerados ou retrocedidos se sua reprodução estiver ficando para trás. Útil para administradores de salas.", + "pauseonleave-tooltip": "Pausar reprodução se você for disconectado ou se alguém sair da sua sala.", + "readyatstart-tooltip": "Definir-se como 'pronto' ao começar (do contrário você será definido como 'não pronto' até mudar seu estado de prontidão)", + "forceguiprompt-tooltip": "Diálogo de configuração não é exibido ao abrir um ficheiro com o Syncplay.", # (Inverted) + "nostore-tooltip": "Começar Syncplay com a dada configuração, mas não guardar as mudanças permanentemente.", # (Inverted) + "rewindondesync-tooltip": "Retroceder automaticamente quando necessário para sincronizar. Desabilitar isto pode resultar em grandes dessincronizações!", + "fastforwardondesync-tooltip": "Avançar automaticamente quando estiver fora de sincronia com o administrador da sala (ou sua posição pretendida caso 'Nunca desacelerar ou retroceder outros' estiver habilitada).", + "showosd-tooltip": "Envia mensagens do Syncplay à tela do reprodutor de mídia (OSD).", + "showosdwarnings-tooltip": "Mostra avisos se: estiver tocando ficheiros diferentes, sozinho na sala, utilizadores não prontos, etc.", + "showsameroomosd-tooltip": "Mostra notificações na tela (OSD) sobre eventos relacionados à sala em que o utilizador está.", + "shownoncontrollerosd-tooltip": "Mostra notificações na tela (OSD) sobre eventos relacionados a não administradores que estão em salas gerenciadas.", + "showdifferentroomosd-tooltip": "Mostra notificações na tela (OSD) sobre eventos relacionados à sala em que o utilizador não está.", + "showslowdownosd-tooltip": "Mostra notificações na tela (OSD) sobre desaceleramento/retrocedimento por conta de diferença nos tempos.", + "showdurationnotification-tooltip": "Útil quando um segmento em um ficheiro de múltiplas partes está faltando, mas pode resultar em falsos positivos.", + "language-tooltip": "Idioma a ser utilizado pelo Syncplay.", + "unpause-always-tooltip": "Se você pressionar para despausar, sempre te definirá como pronto e despausará em vez de simplesmente te definir com pronto.", + "unpause-ifalreadyready-tooltip": "Se você pressionar para despausar quando não estiver pronto, irá te definir como pronto - despause novamente para despausar.", + "unpause-ifothersready-tooltip": "Se você apertar para despausar quando não estiver pronto, só irá despausar quando outros estiverem prontos.", + "unpause-ifminusersready-tooltip": "Se você apertar para despausar quando não estiver pronto, só irá despausar quando outros estiverem prontos e o número mínimo de utilizadores for atingido.", + "trusteddomains-arguments-tooltip": "Domínios para os quais é permitido trocar automaticamente quando as playlists compartilhadas estiverem habilitadas.", + + "chatinputenabled-tooltip": "Ativar entrada de chat via mpv (pressione Enter para escrever, Enter para enviar, ESC para cancelar)", + "chatdirectinput-tooltip": "Evita ter de apertar 'Enter' para entrar no modo de entrada de chat no mpv. Pressione TAB no mpv para temporariamente desabilitar esta função.", + "font-label-tooltip": "Fonte usada ao escrever mensagens no chat no mpv. Apenas no lado do client, portanto não afeta a cor que os outros veem.", + "set-input-font-tooltip": "Família de fonte usada ao escrever mensagens no chat no mpv. Apenas no lado do client, portanto não afeta a cor que os outros veem.", + "set-input-colour-tooltip": "Cor de fonte usada ao escrever mensagens no chat no mpv. Apenas no lado do client, portanto não afeta a cor que os outros veem.", + "chatinputposition-tooltip": "Lugar no mpv onde a entrada de chat será exibida quando você apertar Enter e digitar.", + "chatinputposition-top-tooltip": "Colocar entrada de chat no topo da janela do mpv.", + "chatinputposition-middle-tooltip": "Colocar entrada de chat no meio da janela do mpv.", + "chatinputposition-bottom-tooltip": "Colocar entrada de chat no fundo da janela do mpv.", + "chatoutputenabled-tooltip": "Mostrar mensagens de chat na tela do reprodutor (OSD) (se suportado pelo reprodutor).", + "font-output-label-tooltip": "Fonte da saída de chat.", + "set-output-font-tooltip": "Fonte usada para exibir mensagens do chat.", + "chatoutputmode-tooltip": "Como as mensagens do chat são exibidas.", + "chatoutputmode-chatroom-tooltip": "Exibe novas linhas de chat diretamente abaixo da linha anterior.", + "chatoutputmode-scrolling-tooltip": "Exibe novas linhas de chat rolando-as da direita pra esquerda.", + + "help-tooltip": "Abre o guia de utilizadores do Syncplay.pl.", + "reset-tooltip": "Redefine todas as configurações para seus respectivos padrões.", + "update-server-list-tooltip": "Conecta ao syncplay.pl para atualizar a lista de servidores públicos.", + + "sslconnection-tooltip": "Conectado com segurança ao servidor. Clique para exibir detalhes do certificado.", + + "joinroom-tooltip": "Sair da sala atual e ingressar na sala especificada.", + "seektime-msgbox-label": "Saltar para tempo especificado (em segundos ou minutos:segundos). Use + ou - para fazer um pulo relativo ao tempo atual.", + "ready-tooltip": "Indica se você está pronto para assistir.", + "autoplay-tooltip": "Reproduzir automaticamente quando todos os usuários que tiverem indicadores de prontidão estiverem prontos e o limiar de usuários for atingido.", + "switch-to-file-tooltip": "Clique duas vezes para mudar para {}", # Filename + "sendmessage-tooltip": "Mandar mensagem para a sala", + + # In-userlist notes (GUI) + "differentsize-note": "Tamanhos diferentes!", + "differentsizeandduration-note": "Tamanhos e durações diferentes!", + "differentduration-note": "Durações diferentes!", + "nofile-note": "(Nenhum arquivo está sendo tocado)", + + # Server messages to client + "new-syncplay-available-motd-message": "Você está usando o Syncplay {}, mas uma versão mais nova está disponível em https://syncplay.pl", # ClientVersion + + # Server notifications + "welcome-server-notification": "Seja bem-vindo ao servidor de Syncplay, versão {0}", # version + "client-connected-room-server-notification": "{0}({2}) conectou-se à sala '{1}'", # username, host, room + "client-left-server-notification": "{0} saiu do servidor", # name + "no-salt-notification": "POR FAVOR, NOTE: Para permitir que as senhas de administradores de sala geradas por esta instância do servidor ainda funcionem quando o servidor for reiniciado, por favor, adicione o seguinte argumento de linha de comando ao executar o servidor de Syncplay no futuro: --salt {}", # Salt + + + # Server arguments + "server-argument-description": 'Solução para sincronizar a reprodução de múltiplas instâncias de MPlayer e MPC-HC/BE pela rede. Instância de servidor', + "server-argument-epilog": 'Se nenhuma opção for fornecida, os valores de _config serão utilizados', + "server-port-argument": 'porta TCP do servidor', + "server-password-argument": 'senha do servidor', + "server-isolate-room-argument": 'salas devem ser isoladas?', + "server-salt-argument": "string aleatória utilizada para gerar senhas de salas gerenciadas", + "server-disable-ready-argument": "desativar recurso de prontidão", + "server-motd-argument": "caminho para o arquivo o qual o motd será obtido", + "server-chat-argument": "O chat deve ser desativado?", + "server-chat-maxchars-argument": "Número máximo de caracteres numa mensagem do chat (o padrão é {})", # Default number of characters + "server-maxusernamelength-argument": "Número máximos de caracteres num nome de utilizador (o padrão é {})", + "server-stats-db-file-argument": "Habilita estatísticas de servidor usando o arquivo db SQLite fornecido", + "server-startTLS-argument": "Habilita conexões TLS usando os arquivos de certificado no caminho fornecido", + "server-messed-up-motd-unescaped-placeholders": "A Mensagem do Dia possui placeholders não escapados. Todos os sinais de $ devem ser dobrados (como em $$).", + "server-messed-up-motd-too-long": "A Mensagem do Dia é muito longa - máximo de {} caracteres, {} foram dados.", + + # Server errors + "unknown-command-server-error": "Comando desconhecido: {}", # message + "not-json-server-error": "Não é uma string codificada como JSON: {}", # message + "line-decode-server-error": "Não é uma string UTF-8", + "not-known-server-error": "Você deve ser conhecido pelo servidor antes de mandar este comando", + "client-drop-server-error": "Drop do client: {} -- {}", # host, error + "password-required-server-error": "Senha necessária", + "wrong-password-server-error": "Senha incorreta fornecida", + "hello-server-error": "Not enough Hello arguments", # DO NOT TRANSLATE + + # Playlists + "playlist-selection-changed-notification": "{} mudou a seleção da playlist", # Username + "playlist-contents-changed-notification": "{} atualizou playlist", # Username + "cannot-find-file-for-playlist-switch-error": "Não foi possível encontrar o ficheiro {} no pastas de mídia para a troca de playlist!", # Filename + "cannot-add-duplicate-error": "Não foi possível adicionar uma segunda entrada para '{}' para a playlist uma vez que duplicatas não são permitidas.", # Filename + "cannot-add-unsafe-path-error": "Não foi possível automaticamente carregar {} porque este não é um domínio confiado. Você pode trocar para a URL manualmente dando um clique duplo nela na playlist e adicionando o domínio aos domínios confiáveis em 'Ficheiro -> Avançado -> Definir domínios confiáveis'. Se você clicar com o botão direito na URL, você pode adicionar esta URL como domínio confiável pelo menu de contexto.", # Filename + "sharedplaylistenabled-label": "Habilitar playlists compartilhadas", + "removefromplaylist-menu-label": "Remover da playlist", + "shuffleremainingplaylist-menu-label": "Embaralhar resto da playlist", + "shuffleentireplaylist-menu-label": "Embaralhar toda a playlist", + "undoplaylist-menu-label": "Desfazer última alteração à playlist", + "addfilestoplaylist-menu-label": "Adicionar ficheiro(s) ao final da playlist", + "addurlstoplaylist-menu-label": "Adicionar URL(s) ao final da playlist", + "editplaylist-menu-label": "Editar playlist", + + "open-containing-folder": "Abrir pasta contendo este ficheiro", + "addyourfiletoplaylist-menu-label": "Adicionar seu ficheiro à playlist", + "addotherusersfiletoplaylist-menu-label": "Adicionar ficheiros de {} à playlist", # [Username] + "addyourstreamstoplaylist-menu-label": "Adicionar sua transmissão à playlist", + "addotherusersstreamstoplaylist-menu-label": "Adicionar transmissão de {} à playlist", # [Username] + "openusersstream-menu-label": "Abrir transmissão de {}", # [username]'s + "openusersfile-menu-label": "Abrir ficheiro de {}", # [username]'s + + "playlist-instruction-item-message": "Arraste um ficheiro aqui para adicioná-lo à playlist compartilhada.", + "sharedplaylistenabled-tooltip": "Operadores da sala podem adicionar ficheiros para a playlist compartilhada para tornar mais fácil para todo mundo assistir a mesma coisa. Configure os pastas de mídia em 'Miscelânea'.", +} diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index aa314af..db66581 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -170,7 +170,7 @@ ru = { "file-argument": 'воспроизводимый файл', "args-argument": 'параметры проигрывателя; если нужно передать параметры, начинающиеся с - , то сначала пишите \'--\'', "clear-gui-data-argument": 'сбрасывает путь и данные о состоянии окна GUI, хранимые как QSettings', - "language-argument": 'язык сообщений Syncplay (de/en/ru/it/es/pt_BR)', + "language-argument": 'язык сообщений Syncplay (de/en/ru/it/es/pt_BR/pt_PT)', "version-argument": 'выводит номер версии', "version-message": "Вы используете Syncplay версии {} ({})", From 3761ce26a71708c7c03b93d7cae725e3476bf571 Mon Sep 17 00:00:00 2001 From: Etoh Date: Sun, 21 Jun 2020 12:12:40 +0100 Subject: [PATCH 092/112] Set recent client threshold to 1.6.5 --- syncplay/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/constants.py b/syncplay/constants.py index 7e5d355..a3e6c7a 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -29,7 +29,7 @@ MPLAYER_OSD_LEVEL = 1 UI_TIME_FORMAT = "[%X] " CONFIG_NAMES = [".syncplay", "syncplay.ini"] # Syncplay searches first to last DEFAULT_CONFIG_NAME = "syncplay.ini" -RECENT_CLIENT_THRESHOLD = "1.6.4" # This and higher considered 'recent' clients (no warnings) +RECENT_CLIENT_THRESHOLD = "1.6.5" # This and higher considered 'recent' clients (no warnings) MUSIC_FORMATS = [".mp3", ".m4a", ".m4p", ".wav", ".aiff", ".r", ".ogg", ".flac"] # ALL LOWER CASE! WARN_OLD_CLIENTS = True # Use MOTD to inform old clients to upgrade LIST_RELATIVE_CONFIGS = True # Print list of relative configs loaded From b71f076bbb745764d6ed5724d494e878a8fbd785 Mon Sep 17 00:00:00 2001 From: Etoh Date: Sun, 21 Jun 2020 12:13:15 +0100 Subject: [PATCH 093/112] Mark build 86 and v1.6.5 release --- syncplay/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syncplay/__init__.py b/syncplay/__init__.py index 1e4b167..197a40a 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ version = '1.6.5' -revision = ' development' +revision = ' release' milestone = 'Yoitsu' -release_number = '85' +release_number = '86' projectURL = 'https://syncplay.pl/' From 115a71995f2ceae667c05114da8e8ba21c25c402 Mon Sep 17 00:00:00 2001 From: Etoh Date: Mon, 22 Jun 2020 21:41:27 +0100 Subject: [PATCH 094/112] Move to 1.6.6 dev for further development --- syncplay/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syncplay/__init__.py b/syncplay/__init__.py index 197a40a..c394fe2 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ -version = '1.6.5' -revision = ' release' +version = '1.6.6' +revision = ' development' milestone = 'Yoitsu' -release_number = '86' +release_number = '87' projectURL = 'https://syncplay.pl/' From a9ce9ec6d0ff8bfda4b194fd758288e853cc0f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wr=C3=B3bel?= Date: Wed, 24 Jun 2020 19:53:07 +0200 Subject: [PATCH 095/112] Fixed version generation string for deb package. Previously it failed when trying to build a release version. --- travis/deb-script.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/travis/deb-script.sh b/travis/deb-script.sh index 8853d82..2dc0a42 100755 --- a/travis/deb-script.sh +++ b/travis/deb-script.sh @@ -6,7 +6,14 @@ set -e mkdir -p /tmp/syncplay/DEBIAN echo "Package: syncplay -Version: "$(sed -n -e "s/^.*version = //p" syncplay/__init__.py | sed "s/'//g")""$(git describe --exact-match --tags HEAD &>/dev/null && echo -git-$(date -u +%y%m%d%H%M))" +Version: "$( + sed -n -e "s/^.*version = //p" syncplay/__init__.py | sed "s/'//g" +)$( + if [[ $(git describe --exact-match --tags HEAD | wc -l) = '0' ]]; + then + echo -git-$(date -u +%y%m%d%H%M) + fi +)" Architecture: all Maintainer: Depends: python3 (>= 3.4), python3-pyside2.qtwidgets, python3-pyside2.qtcore, python3-twisted (>= 16.4.0), python3-certifi, mpv (>= 0.23) | vlc (>= 2.2.1) From 4d2826aa73f8aac1c94bb6213836a1a853b66f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wr=C3=B3bel?= Date: Wed, 24 Jun 2020 19:59:27 +0200 Subject: [PATCH 096/112] Remove bash specific syntax from deb build script. --- travis/deb-script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/deb-script.sh b/travis/deb-script.sh index 2dc0a42..40745cd 100755 --- a/travis/deb-script.sh +++ b/travis/deb-script.sh @@ -9,7 +9,7 @@ echo "Package: syncplay Version: "$( sed -n -e "s/^.*version = //p" syncplay/__init__.py | sed "s/'//g" )$( - if [[ $(git describe --exact-match --tags HEAD | wc -l) = '0' ]]; + if [ $(git describe --exact-match --tags HEAD | wc -l) = '0' ]; then echo -git-$(date -u +%y%m%d%H%M) fi From dac06715f5c00883d7359b4098d332d74614f01f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wr=C3=B3bel?= Date: Thu, 25 Jun 2020 09:17:59 +0200 Subject: [PATCH 097/112] Disable native wayland for snap Snap is using QT4 (due to lack of pyside2 in core18) which is not compatible with Wayland. Hopefully this should prevent #331 from occurring. --- snapcraft.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snapcraft.yaml b/snapcraft.yaml index b92af89..4464b60 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -29,6 +29,8 @@ apps: syncplay: command: bin/desktop-launch $SNAP/usr/bin/python3 $SNAP/bin/syncplay desktop: lib/python3.5/site-packages/syncplay/resources/syncplay.desktop + environment: + DISABLE_WAYLAND: 1 syncplay-server: command: bin/syncplay-server From 1ad10632c6f027f8de74bcf211b4bf872c5e2678 Mon Sep 17 00:00:00 2001 From: et0h Date: Thu, 25 Jun 2020 13:00:02 +0100 Subject: [PATCH 098/112] Fix error with double quotes in mpv chat messages (#329) --- syncplay/resources/syncplayintf.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syncplay/resources/syncplayintf.lua b/syncplay/resources/syncplayintf.lua index 677a781..b663c02 100644 --- a/syncplay/resources/syncplayintf.lua +++ b/syncplay/resources/syncplayintf.lua @@ -626,14 +626,14 @@ function wordwrapify_string(line) local nextChar = 0 local chars = 0 local maxChars = str:len() - + str = string.gsub(str, "\\\"", "\""); repeat nextChar = next_utf8(str, currentChar) if nextChar == currentChar then return newstr end local charToTest = str:sub(currentChar,nextChar-1) - if charToTest ~= "\\" and charToTest ~= "{" and charToTest ~= "}" and charToTest ~= "%" then + if charToTest ~= "{" and charToTest ~= "}" and charToTest ~= "%" then newstr = newstr .. WORDWRAPIFY_MAGICWORD .. str:sub(currentChar,nextChar-1) else newstr = newstr .. str:sub(currentChar,nextChar-1) From be92ff8b6ddf50c9949d290d43d4dd8e3b19e4bf Mon Sep 17 00:00:00 2001 From: Borislav Draganov Date: Thu, 6 Aug 2020 15:12:49 +0300 Subject: [PATCH 099/112] Fixed MPC crashes when trying to open YouTube videos with emojis (#328) * Fixed crashes when trying to open YouTube videos with emojis --- syncplay/players/mpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/players/mpc.py b/syncplay/players/mpc.py index 68f7e9b..d53645a 100755 --- a/syncplay/players/mpc.py +++ b/syncplay/players/mpc.py @@ -86,7 +86,7 @@ class MpcHcApi: _fields_ = [ ('nMsgPos', ctypes.c_int32), ('nDurationMS', ctypes.c_int32), - ('strMsg', ctypes.c_wchar * (len(message) + 1)) + ('strMsg', ctypes.c_wchar * (len(message.encode('utf-8')) + 1)) ] cmessage = __OSDDATASTRUCT() cmessage.nMsgPos = MsgPos From 70382e1a78db16e394e75b3c212cda243823f559 Mon Sep 17 00:00:00 2001 From: Etoh Date: Thu, 6 Aug 2020 20:22:39 +0100 Subject: [PATCH 100/112] Hello error not to be translated as per AtilioA review of #317 --- syncplay/messages_pt_BR.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py index 649cd99..8631499 100644 --- a/syncplay/messages_pt_BR.py +++ b/syncplay/messages_pt_BR.py @@ -127,7 +127,7 @@ pt_BR = { "empty-value-config-error": "{} não pode ser vazio", # Config option "not-json-error": "Não é uma string codificada como JSON\n", - "hello-arguments-error": "Falta de argumentos Hello\n", # DO NOT TRANSLATE + "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-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.", From 86bd299a58ad7c81d6d331bd5091669d275751b2 Mon Sep 17 00:00:00 2001 From: Gabriel Dolberg Date: Sun, 13 Sep 2020 14:49:25 +0300 Subject: [PATCH 101/112] Room history (#337) * Add room history mechanism (Syncplay#336) * new 'roomhistory' value in configuration * change gui room input to combobox to display history * update history upon startup using the configuration room * Prevent room history from saving empty room name * Add rooms editing ability * add rooms dialog * new button to open rooms dialog --- syncplay/ui/ConfigurationGetter.py | 4 ++- syncplay/ui/GuiConfiguration.py | 57 ++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/syncplay/ui/ConfigurationGetter.py b/syncplay/ui/ConfigurationGetter.py index 8586301..876748f 100755 --- a/syncplay/ui/ConfigurationGetter.py +++ b/syncplay/ui/ConfigurationGetter.py @@ -29,6 +29,7 @@ class ConfigurationGetter(object): "noGui": False, "noStore": False, "room": "", + "roomhistory": [], "password": None, "playerPath": None, "perPlayerArguments": None, @@ -149,6 +150,7 @@ class ConfigurationGetter(object): ] self._serialised = [ + "roomhistory", "perPlayerArguments", "mediaSearchDirectories", "trustedDomains", @@ -181,7 +183,7 @@ class ConfigurationGetter(object): self._iniStructure = { "server_data": ["host", "port", "password"], "client_settings": [ - "name", "room", "playerPath", + "name", "room", "roomhistory", "playerPath", "perPlayerArguments", "slowdownThreshold", "rewindThreshold", "fastforwardThreshold", "slowOnDesync", "rewindOnDesync", diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index 2e7715a..45879f2 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -156,6 +156,28 @@ class ConfigDialog(QtWidgets.QDialog): def openHelp(self): self.QtGui.QDesktopServices.openUrl(QUrl("https://syncplay.pl/guide/client/")) + def openRoomsDialog(self): + RoomsDialog = QtWidgets.QDialog() + RoomsDialog.setWindowFlags(Qt.FramelessWindowHint) + RoomsLayout = QtWidgets.QGridLayout() + RoomsTextbox = QtWidgets.QPlainTextEdit() + RoomsTextbox.setLineWrapMode(QtWidgets.QPlainTextEdit.NoWrap) + RoomsTextbox.setPlainText(utils.getListAsMultilineString(self.config['roomhistory'])) + RoomsLayout.addWidget(RoomsTextbox, 0, 0, 1, 1) + RoomsButtonBox = QtWidgets.QDialogButtonBox() + RoomsButtonBox.setOrientation(Qt.Horizontal) + RoomsButtonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel) + RoomsButtonBox.accepted.connect(RoomsDialog.accept) + RoomsButtonBox.rejected.connect(RoomsDialog.reject) + RoomsLayout.addWidget(RoomsButtonBox, 1, 0, 1, 1) + RoomsDialog.setLayout(RoomsLayout) + RoomsDialog.setModal(True) + RoomsDialog.show() + result = RoomsDialog.exec_() + if result == QtWidgets.QDialog.Accepted: + newRooms = utils.convertMultilineStringToList(RoomsTextbox.toPlainText()) + self.relistRoomHistory(newRooms) + def safenormcaseandpath(self, path): if utils.isURL(path): return path @@ -380,6 +402,27 @@ class ConfigDialog(QtWidgets.QDialog): settings.setValue("publicServers", servers) self.hostCombobox.setEditText(currentServer) + def fillRoomsCombobox(self): + self.roomsCombobox.clear() + for roomHistoryValue in self.config['roomhistory']: + self.roomsCombobox.addItem(roomHistoryValue) + + def relistRoomHistory(self, newRooms): + filteredNewRooms = [room for room in newRooms if room and not room.isspace()] + self.config['roomhistory'] = filteredNewRooms + self.fillRoomsCombobox() + + def addRoomToHistory(self, newRoom=None): + if newRoom is None: + newRoom = self.roomsCombobox.currentText() + if not newRoom: + return + roomHistory = self.config['roomhistory'] + if newRoom in roomHistory: + roomHistory.remove(newRoom) + roomHistory.insert(0, newRoom) + self.config['roomhistory'] = roomHistory + def showErrorMessage(self, errorMessage): QtWidgets.QMessageBox.warning(self, "Syncplay", errorMessage) @@ -447,6 +490,7 @@ class ConfigDialog(QtWidgets.QDialog): else: self.config['file'] = str(self.mediapathTextbox.text()) self.config['publicServers'] = self.publicServerAddresses + self.config['room'] = self.roomsCombobox.currentText() self.pressedclosebutton = False self.close() @@ -599,11 +643,17 @@ class ConfigDialog(QtWidgets.QDialog): self.usernameTextbox.setObjectName("name") self.serverpassLabel = QLabel(getMessage("password-label"), self) - self.defaultroomTextbox = QLineEdit(self) + self.roomsCombobox = QtWidgets.QComboBox(self) + self.roomsCombobox.setEditable(True) + self.addRoomToHistory(config['room']) + self.fillRoomsCombobox() self.usernameLabel = QLabel(getMessage("name-label"), self) self.serverpassTextbox = QLineEdit(self) self.serverpassTextbox.setText(self.storedPassword) self.defaultroomLabel = QLabel(getMessage("room-label"), self) + self.editRoomsButton = QtWidgets.QToolButton() + self.editRoomsButton.setIcon(QtGui.QIcon(resourcespath + 'eye.png')) + self.editRoomsButton.released.connect(self.openRoomsDialog) self.hostLabel.setObjectName("host") self.hostCombobox.setObjectName(constants.LOAD_SAVE_MANUALLY_MARKER + "host") @@ -614,7 +664,7 @@ class ConfigDialog(QtWidgets.QDialog): self.hostCombobox.editTextChanged.connect(self.updatePasswordVisibilty) self.hostCombobox.currentIndexChanged.connect(self.updatePasswordVisibilty) self.defaultroomLabel.setObjectName("room") - self.defaultroomTextbox.setObjectName("room") + self.roomsCombobox.setObjectName("room") self.connectionSettingsLayout = QtWidgets.QGridLayout() self.connectionSettingsLayout.addWidget(self.hostLabel, 0, 0) @@ -624,7 +674,8 @@ class ConfigDialog(QtWidgets.QDialog): self.connectionSettingsLayout.addWidget(self.usernameLabel, 2, 0) self.connectionSettingsLayout.addWidget(self.usernameTextbox, 2, 1) self.connectionSettingsLayout.addWidget(self.defaultroomLabel, 3, 0) - self.connectionSettingsLayout.addWidget(self.defaultroomTextbox, 3, 1) + self.connectionSettingsLayout.addWidget(self.editRoomsButton, 3, 0, Qt.AlignRight) + self.connectionSettingsLayout.addWidget(self.roomsCombobox, 3, 1) self.connectionSettingsLayout.setSpacing(10) self.connectionSettingsGroup.setLayout(self.connectionSettingsLayout) if isMacOS(): From 3c7ca9706d7dfb00d7e1a84ebae7a534d54d42b9 Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 13 Sep 2020 14:26:06 +0100 Subject: [PATCH 102/112] Rename room history to room list & re-work GUI --- syncplay/client.py | 7 +++ syncplay/messages_de.py | 3 + syncplay/messages_en.py | 3 + syncplay/messages_es.py | 3 + syncplay/messages_it.py | 3 + syncplay/messages_pt_BR.py | 3 + syncplay/messages_pt_PT.py | 3 + syncplay/messages_ru.py | 3 + syncplay/resources/bullet_edit_centered.png | Bin 0 -> 632 bytes syncplay/resources/door_open_edit.png | Bin 0 -> 743 bytes syncplay/ui/ConfigurationGetter.py | 6 +- syncplay/ui/GuiConfiguration.py | 42 +++++++------ syncplay/ui/gui.py | 63 ++++++++++++++++---- 13 files changed, 108 insertions(+), 31 deletions(-) create mode 100644 syncplay/resources/bullet_edit_centered.png create mode 100644 syncplay/resources/door_open_edit.png diff --git a/syncplay/client.py b/syncplay/client.py index a712390..6a2a5ae 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -533,6 +533,13 @@ class SyncplayClient(object): # TODO: Properly add message for setting trusted domains! # TODO: Handle cases where users add www. to start of domain + def setRoomList(self, newRoomList): + from syncplay.ui.ConfigurationGetter import ConfigurationGetter + ConfigurationGetter().setConfigOption("roomList", newRoomList) + oldRoomList = self._config['roomList'] + if oldRoomList != newRoomList: + self._config['roomList'] = newRoomList + def isUntrustedTrustableURI(self, URIToTest): if utils.isURL(URIToTest): for trustedProtocol in constants.TRUSTABLE_WEB_PROTOCOLS: diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index fea05f3..0354e46 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -184,6 +184,7 @@ de = { "name-label": "Benutzername (optional):", "password-label": "Server-Passwort (falls nötig):", "room-label": "Standard-Raum:", + "roomlist-msgbox-label": "Edit room list (one per line)", # TODO: Translate "media-setting-title": "Media-Player Einstellungen", "executable-path-label": "Pfad zum Media-Player:", @@ -373,6 +374,8 @@ de = { "password-tooltip": "Passwörter sind nur bei Verbindung zu privaten Servern nötig.", "room-tooltip": "Der Raum, der betreten werden soll, kann ein x-beliebiger sein. Allerdings werden nur Clients im selben Raum synchronisiert.", + "edit-rooms-tooltip": "Edit room list.", # TO DO: Translate + "executable-path-tooltip": "Pfad zum ausgewählten, unterstützten Mediaplayer (mpv, mpv.net, VLC, MPC-HC/BE or mplayer2).", "media-path-tooltip": "Pfad zum wiederzugebenden Video oder Stream. Notwendig für mplayer2.", "player-arguments-tooltip": "Zusätzliche Kommandozeilenparameter/-schalter für diesen Mediaplayer.", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 548f42a..aed1a40 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -184,6 +184,7 @@ en = { "name-label": "Username (optional):", "password-label": "Server password (if any):", "room-label": "Default room: ", + "roomlist-msgbox-label": "Edit room list (one per line)", "media-setting-title": "Media player settings", "executable-path-label": "Path to media player:", @@ -374,6 +375,8 @@ en = { "password-tooltip": "Passwords are only needed for connecting to private servers.", "room-tooltip": "Room to join upon connection can be almost anything, but you will only be synchronised with people in the same room.", + "edit-rooms-tooltip": "Edit room list.", + "executable-path-tooltip": "Location of your chosen supported media player (mpv, mpv.net, VLC, MPC-HC/BE or mplayer2).", "media-path-tooltip": "Location of video or stream to be opened. Necessary for mplayer2.", "player-arguments-tooltip": "Additional command line arguments / switches to pass on to this media player.", diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index edd2878..e286294 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -184,6 +184,7 @@ es = { "name-label": "Nombre de usuario (opcional):", "password-label": "Contraseña del servidor (si corresponde):", "room-label": "Sala por defecto: ", + "roomlist-msgbox-label": "Edit room list (one per line)", # TODO: Translate "media-setting-title": "Configuración del reproductor multimedia", "executable-path-label": "Ruta al reproductor multimedia:", @@ -374,6 +375,8 @@ es = { "password-tooltip": "Las contraseñas son sólo necesarias para conectarse a servidores privados.", "room-tooltip": "La sala para unirse en la conexión puede ser casi cualquier cosa, pero sólo se sincronizará con las personas en la misma sala.", + "edit-rooms-tooltip": "Edit room list.", # TO DO: Translate + "executable-path-tooltip": "Ubicación de tu reproductor multimedia compatible elegido (mpv, mpv.net, VLC, MPC-HC/BE o mplayer2).", "media-path-tooltip": "Ubicación del video o flujo que se abrirá. Necesario para mplayer2.", "player-arguments-tooltip": "Arguementos de línea de comandos adicionales / parámetros para pasar a este reproductor multimedia.", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 6eae224..9976a63 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -184,6 +184,7 @@ it = { "name-label": "Username (opzionale):", "password-label": "Password del server (se necessaria):", "room-label": "Stanza di default: ", + "roomlist-msgbox-label": "Edit room list (one per line)", # TODO: Translate "media-setting-title": "Impostazioni del media player", "executable-path-label": "Percorso del media player:", @@ -374,6 +375,8 @@ it = { "password-tooltip": "La password è necessaria solo in caso di connessione a server privati.", "room-tooltip": "La stanza in cui entrare dopo la connessione. Può assumere qualsiasi nome, ma ricorda che sarai sincronizzato solo con gli utenti nella stessa stanza.", + "edit-rooms-tooltip": "Edit room list.", # TO DO: Translate + "executable-path-tooltip": "Percorso del media player desiderato (scegliere tra mpv, mpv.net, VLC, MPC-HC/BE or mplayer2).", "media-path-tooltip": "Percorso del video o stream da aprire. Necessario per mplayer2.", "player-arguments-tooltip": "Argomenti da linea di comando aggiuntivi da passare al media player scelto.", diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py index 8631499..199be1b 100644 --- a/syncplay/messages_pt_BR.py +++ b/syncplay/messages_pt_BR.py @@ -184,6 +184,7 @@ pt_BR = { "name-label": "Nome de usuário (opcional): ", "password-label": "Senha do servidor (se existir): ", "room-label": "Sala padrão: ", + "roomlist-msgbox-label": "Edit room list (one per line)", # TODO: Translate "media-setting-title": "Configurações do reprodutor de mídia", "executable-path-label": "Executável do reprodutor:", @@ -374,6 +375,8 @@ pt_BR = { "password-tooltip": "Senhas são necessárias apenas para servidores privados.", "room-tooltip": "O nome da sala para se conectar pode ser praticamente qualquer coisa, mas você só irá se sincronizar com pessoas na mesma sala.", + "edit-rooms-tooltip": "Edit room list.", # TO DO: Translate + "executable-path-tooltip": "Localização do seu reprodutor de mídia preferido (mpv, mpv.net, VLC, MPC-HC/BE ou mplayer2).", "media-path-tooltip": "Localização do vídeo ou transmissão a ser aberto. Necessário com o mplayer2.", "player-arguments-tooltip": "Argumentos de comando de linha adicionais para serem repassados ao reprodutor de mídia.", diff --git a/syncplay/messages_pt_PT.py b/syncplay/messages_pt_PT.py index 5c4e10a..1138e76 100644 --- a/syncplay/messages_pt_PT.py +++ b/syncplay/messages_pt_PT.py @@ -184,6 +184,7 @@ pt_PT = { "name-label": "Nome de utilizador (opcional): ", "password-label": "Senha do servidor (se existir): ", "room-label": "Sala padrão: ", + "roomlist-msgbox-label": "Edit room list (one per line)", # TODO: Translate "media-setting-title": "Configurações do reprodutor de mídia", "executable-path-label": "Executável do reprodutor:", @@ -374,6 +375,8 @@ pt_PT = { "password-tooltip": "Senhas são necessárias apenas para servidores privados.", "room-tooltip": "O nome da sala para se conectar pode ser praticamente qualquer coisa, mas você só irá se sincronizar com utilizadores na mesma sala.", + "edit-rooms-tooltip": "Edit room list.", # TO DO: Translate + "executable-path-tooltip": "Localização do seu reprodutor de mídia preferido (mpv, mpv.net, VLC, MPC-HC/BE ou mplayer2).", "media-path-tooltip": "Localização do vídeo ou transmissão a ser aberto. Necessário com o mplayer2.", "player-arguments-tooltip": "Argumentos de comando de linha adicionais para serem repassados ao reprodutor de mídia.", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index db66581..225c49e 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -185,6 +185,7 @@ ru = { "name-label": "Имя пользователя (не обязательно):", "password-label": "Пароль сервера (если требуется):", "room-label": "Комната:", + "roomlist-msgbox-label": "Edit room list (one per line)", # TODO: Translate "media-setting-title": "Воспроизведение", "executable-path-label": "Путь к проигрывателю:", @@ -377,6 +378,8 @@ ru = { "password-tooltip": "Пароли нужны для подключения к приватным серверам.", "room-tooltip": "Комната, в которую Вы попадете сразу после подключения. Синхронизация возможна только между людьми в одной и той же комнате.", + "edit-rooms-tooltip": "Edit room list.", # TO DO: Translate + "executable-path-tooltip": "Расположение Вашего видеопроигрывателя (mpv, mpv.net, VLC, MPC-HC/BE или mplayer2).", "media-path-tooltip": "Расположение видеофайла или потока для просмотра. Обязательно для mplayer2.", # TODO: Confirm translation "player-arguments-tooltip": "Передавать дополнительные аргументы командной строки этому проигрывателю.", diff --git a/syncplay/resources/bullet_edit_centered.png b/syncplay/resources/bullet_edit_centered.png new file mode 100644 index 0000000000000000000000000000000000000000..99d91fa7ccb472b9045f560ca825fb6bb6650bd7 GIT binary patch literal 632 zcmV-;0*C#HP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGyzyJUqzyT31wzmKP0u4z-K~y+TV`Lx` z{Qv(SOf!K=3IN3hz`X!-5(v08Tw?hD?=Qo@zkeC_wwf^9+h7*{`Ki`2OxX!}kX#8F=|582E%`c%aG|SfDh+cfSCJ zO@hV@|0P`*{{H{RFiF?PLqsiS8^5wU!s~Hv~9|_i|GU~{CGN@fr<4G!>`YZ46hF!|NQs+7bmsilV_k>zyKu{wzo(H zE0{(tQ@8VH`}J}m10(Y}99CtyTQ!sGy~Ntt-SzyJUo)6bzM S)q<1&0000?P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0(?nCK~y+Tm6P8~ zQ(+j#zdL8=c-(fT8@eVg*K!v9(DXtGRD`_Kw5J3`l zllFs(LPj>-GH|-A;pQ|=c7DC@+j|bpZC(UE@bJ7G&iC{DdS4e~49B(9qg!_ktxjJ0eEK|wAY0;Z>@8Ko2zCxjfv8y6V_P{=J|_+oKTLh)t(Dg4w` z1x!s%u}CE1oLw$gT^vy6AqWJbuNw!&1;`#1>v<6#!zu{QAKdIrw$+MlZ&lV1XpbP= zeGTy|*AeZXKylLoqXed@^UD624XB7J9+bXgs7FMwYXIfa3d-4!Q2k-3fi@1HFbu5< zuq>-i+$3Z$+~-Df*9eI5l9#=K_2eu*y?6}S?{xsCSp%r8z{i$xwci$xLi_m;E@=mn zPep^a!Lus}w-vyc#Ve?3p;AGk^%cXt5}M*;&^8}HkW3hRr?9o~8D(!L)Mg#Q=50t~ zxxNA$plB)dbchID7=@9afhaTRdr{=)KY(@&!V+ZcmPBN;Ezk|Aeux2*MQ=<2K?J{+ z?(wZ_I4HGa^K}wyMSyWJA__3J5R%i^m+yaAVcEmhVp4E27 zjsTW2dE8Ch$D3DkD5_zQ%ab6DC!E3Bz1mqlfs^nAqmVoS-V@`S^Ocp3$M!8sCXeO9!PQn_W$f+BePh23;(m3n;jvZt& Date: Sun, 13 Sep 2020 15:36:04 +0200 Subject: [PATCH 103/112] changed mpvnet icon from .ico to .png for consistency (#348) --- syncplay/constants.py | 2 +- syncplay/resources/mpvnet.ico | Bin 25723 -> 0 bytes syncplay/resources/mpvnet.png | Bin 0 -> 632 bytes 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 syncplay/resources/mpvnet.ico create mode 100644 syncplay/resources/mpvnet.png diff --git a/syncplay/constants.py b/syncplay/constants.py index a3e6c7a..bb35d9e 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -174,7 +174,7 @@ VLC_PATHS = [ VLC_ICONPATH = "vlc.png" MPLAYER_ICONPATH = "mplayer.png" MPV_ICONPATH = "mpv.png" -MPVNET_ICONPATH = "mpvnet.ico" +MPVNET_ICONPATH = "mpvnet.png" MPC_ICONPATH = "mpc-hc.png" MPC64_ICONPATH = "mpc-hc64.png" MPC_BE_ICONPATH = "mpc-be.png" diff --git a/syncplay/resources/mpvnet.ico b/syncplay/resources/mpvnet.ico deleted file mode 100644 index a70ca15629bd4846a7147e7f2767fd06f00cbbb5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25723 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 E1A0)V&j0`b diff --git a/syncplay/resources/mpvnet.png b/syncplay/resources/mpvnet.png new file mode 100644 index 0000000000000000000000000000000000000000..90ef1c7fe84490426813cfe7c58b6a22dd6e45d4 GIT binary patch literal 632 zcmV-;0*C#HP)cOH@%5z+aF^pH}Ls zl{=x?v}q9pfe{2E5f~)Vs)G6_DyYyB(iz{(*!aOji$E=;bjI3bsZDA{P@5viX_}l$ zCmc;$#IJMSeKhY)uf^frd)_&}dp<3|s+30y>^n5fP*sGYik?*$Wb3NJMc zHtfFxC&%E_I2;^;O;HyjHfk$AwSNJ})ATD{4R-gz#V0WM61p=G7D>#*<)_dvP>!TE z#ef5t%(1sRN=d`qEU#P==ZH9cUV#tG0(maLN$8n{_G#E2GbvTstj!f@v<{3g>J&?q zO~cST2OZM}@b)Vd*J13Pfy4yTe9x^(7+M~Xw8VMU0Z3?P((;nLczwnI!r~AW;Kw4o zUy@W_!1;$_+id_FZ59=9rdMf%U8s$QlKkSrt%8N{(zg(jSG)WM>-|4oxK%BblR9Ix3OW+gq?h4 zoVuQwHeM6w#$-Sn-9f7L4w6RFB*Sw$ZR&F5F4V+5gB0V7Z;;$k4mqRjM)J=ntH_ww z#rTw2Bow$zx+o`PVYb;UIh}ErNzba2e|`U5Ca=uo2_3sn{}!99ik?*$Wcvr`?&;AB S+kV9W0000 Date: Sun, 13 Sep 2020 20:38:24 +0700 Subject: [PATCH 104/112] MPV: Add possibility to control which socket to use (#320) Co-authored-by: Denis Fomin --- syncplay/players/mpv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index 83ab65a..33f02a9 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -593,7 +593,8 @@ class MpvPlayer(BasePlayer): env['PATH'] = '/usr/bin:/usr/local/bin' env['PYTHONPATH'] = pythonPath try: - self.mpvpipe = MPV(mpv_location=self.playerPath, loglevel="info", log_handler=self.__playerController.mpv_log_handler, quit_callback=self.stop_client, **self.mpv_arguments) + socket = self.mpv_arguments.get('input-ipc-server') + self.mpvpipe = MPV(mpv_location=self.playerPath, ipc_socket=socket, loglevel="info", log_handler=self.__playerController.mpv_log_handler, quit_callback=self.stop_client, **self.mpv_arguments) except Exception as e: self.quitReason = getMessage("media-player-error").format(str(e)) + " " + getMessage("mpv-failed-advice") self.__playerController.reactor.callFromThread(self.__playerController._client.ui.showErrorMessage, self.quitReason, True) From b09fb90b349870cb454d33b732911deb5bab0f14 Mon Sep 17 00:00:00 2001 From: Florian Badie Date: Sun, 13 Sep 2020 17:45:38 +0200 Subject: [PATCH 105/112] Console improvements (#327), including work from #316 and #319 * add videos to playlist from chat * add urls to playlist * add files in media directory to playlist * add commands to show the playlist and select an index * add command to delete files from the playlist * show selected index in playlist * fix adding files with queue command in GUI mode * start indexing the playlist at 1 or at least that's what it would look like to the user * start all commands related to playlist with `q` Co-authored-by: kiscs --- syncplay/client.py | 11 ++++++++- syncplay/constants.py | 4 ++++ syncplay/messages_en.py | 4 ++++ syncplay/ui/consoleUI.py | 51 +++++++++++++++++++++++++++++++++++++--- syncplay/ui/gui.py | 4 ++-- 5 files changed, 68 insertions(+), 6 deletions(-) diff --git a/syncplay/client.py b/syncplay/client.py index 6a2a5ae..f596ad5 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -1887,6 +1887,15 @@ class SyncplayPlaylist(): self._ui.setPlaylist(self._playlist) self._ui.showMessage(getMessage("playlist-contents-changed-notification").format(username)) + def addToPlaylist(self, file): + self.changePlaylist([*self._playlist, file]) + + def deleteAtIndex(self, index): + new_playlist = self._playlist.copy() + if index < len(new_playlist): + del new_playlist[index] + self.changePlaylist(new_playlist) + @needsSharedPlaylistsEnabled def undoPlaylistChange(self): if self.canUndoPlaylist(self._playlist): @@ -2005,7 +2014,7 @@ class FileSwitchManager(object): self.mediaFilesCache = {} self.filenameWatchlist = [] self.currentDirectory = None - self.mediaDirectories = None + self.mediaDirectories = client.getConfig().get('mediaSearchDirectories') self.lock = threading.Lock() self.folderSearchEnabled = True self.directorySearchError = None diff --git a/syncplay/constants.py b/syncplay/constants.py index bb35d9e..f3b9a0d 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -124,6 +124,10 @@ COMMANDS_HELP = ['help', 'h', '?', '/?', r'\?'] COMMANDS_CREATE = ['c', 'create'] COMMANDS_AUTH = ['a', 'auth'] COMMANDS_TOGGLE = ['t', 'toggle'] +COMMANDS_QUEUE = ['queue', 'qa', 'add'] +COMMANDS_PLAYLIST = ['playlist', 'ql', 'pl'] +COMMANDS_SELECT = ['select', 'qs'] +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" diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index aed1a40..ed61b42 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -87,6 +87,10 @@ en = { "commandlist-notification/create": "\tc [name] - create managed room using name of current room", "commandlist-notification/auth": "\ta [password] - authenticate as room operator with operator password", "commandlist-notification/chat": "\tch [message] - send a chat message in a room", + "commandList-notification/queue": "\tqa [file/url] - add file or url to bottom of playlist", + "commandList-notification/playlist": "\tql - show the current playlist", + "commandList-notification/select": "\tqs [index] - select given entry in the playlist", + "commandList-notification/delete": "\tqd [index] - delete the given entry from the playlist", "syncplay-version-notification": "Syncplay version: {}", # syncplay.version "more-info-notification": "More info available at: {}", # projectURL diff --git a/syncplay/ui/consoleUI.py b/syncplay/ui/consoleUI.py index a7d2a4c..f0c463a 100755 --- a/syncplay/ui/consoleUI.py +++ b/syncplay/ui/consoleUI.py @@ -3,12 +3,13 @@ import re import sys import threading import time +import os import syncplay from syncplay import constants from syncplay import utils from syncplay.messages import getMessage -from syncplay.utils import formatTime +from syncplay.utils import formatTime, isURL class ConsoleUI(threading.Thread): @@ -22,8 +23,13 @@ class ConsoleUI(threading.Thread): def addClient(self, client): self._syncplayClient = client - def addFileToPlaylist(self): - pass + def addFileToPlaylist(self, file): + if not isURL(file): + if not self._syncplayClient.fileSwitch.findFilepath(file): + print(f"{file} is not in any media directory") + return + + self._syncplayClient.playlist.addToPlaylist(file) def drop(self): pass @@ -184,6 +190,41 @@ class ConsoleUI(threading.Thread): self._syncplayClient.identifyAsController(controlpassword) elif command.group('command') in constants.COMMANDS_TOGGLE: self._syncplayClient.toggleReady() + elif command.group('command') in constants.COMMANDS_QUEUE: + filename = command.group('parameter') + if filename is None: + self.showErrorMessage("No file/url given") + return + + self._syncplayClient.ui.addFileToPlaylist(filename) + elif command.group('command') in constants.COMMANDS_PLAYLIST: + playlist = self._syncplayClient.playlist + playlist_elements = [f"\t{i+1}: {el}" for i, el in enumerate(playlist._playlist)] + + if playlist_elements: + i = playlist._playlistIndex + if i is not None and i in range(len(playlist_elements)): + playlist_elements[i] = " *" + playlist_elements[i] + + print(*playlist_elements, sep='\n') + else: + print("playlist is currently empty.") + elif command.group('command') in constants.COMMANDS_SELECT: + try: + index = int(command.group('parameter').strip()) - 1 + self._syncplayClient.playlist.changeToPlaylistIndex(index, resetPosition=True) + self._syncplayClient.rewindFile() + + except TypeError: + print("invalid index") + elif command.group('command') in constants.COMMANDS_DELETE: + try: + index = int(command.group('parameter').strip()) - 1 + self._syncplayClient.playlist.deleteAtIndex(index) + + except TypeError: + print("invalid index") + else: if self._tryAdvancedCommands(data): return @@ -200,6 +241,10 @@ class ConsoleUI(threading.Thread): self.showMessage(getMessage("commandlist-notification/create"), True) self.showMessage(getMessage("commandlist-notification/auth"), True) self.showMessage(getMessage("commandlist-notification/chat"), True) + self.showMessage(getMessage("commandList-notification/queue"), True) + self.showMessage(getMessage("commandList-notification/playlist"), True) + self.showMessage(getMessage("commandList-notification/select"), True) + self.showMessage(getMessage("commandList-notification/delete"), True) self.showMessage(getMessage("syncplay-version-notification").format(syncplay.version), True) self.showMessage(getMessage("more-info-notification").format(syncplay.projectURL), True) diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index ec3d30a..c2add97 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -1924,7 +1924,7 @@ class MainWindow(QtWidgets.QMainWindow): self.playlist.setPlaylistIndexFilename(filename) def addFileToPlaylist(self, filePath, index=-1): - if os.path.isfile(filePath): + if not isURL: self.removePlaylistNote() filename = os.path.basename(filePath) if self.noPlaylistDuplicates(filename): @@ -1933,7 +1933,7 @@ class MainWindow(QtWidgets.QMainWindow): else: self.playlist.insertItem(index, filename) self._syncplayClient.fileSwitch.notifyUserIfFileNotInMediaDirectory(filename, filePath) - elif isURL(filePath): + else: self.removePlaylistNote() if self.noPlaylistDuplicates(filePath): if self.playlist == -1 or index == -1: From 24beaebbd1b3bbccce94db52b16a6707699b9a43 Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 13 Sep 2020 16:49:36 +0100 Subject: [PATCH 106/112] Add translation stubs for console improvements (#327) --- syncplay/messages_de.py | 4 ++++ syncplay/messages_es.py | 4 ++++ syncplay/messages_it.py | 4 ++++ syncplay/messages_pt_BR.py | 4 ++++ syncplay/messages_pt_PT.py | 4 ++++ syncplay/messages_ru.py | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 0354e46..b7a7961 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -87,6 +87,10 @@ de = { "commandlist-notification/create": "\tc [name] - erstelle zentral gesteuerten Raum mit dem aktuellen Raumnamen", "commandlist-notification/auth": "\ta [password] - authentifiziere als Raumleiter mit Passwort", "commandlist-notification/chat": "\tch [message] - Chatnachricht an einem Raum senden", + "commandList-notification/queue": "\tqa [file/url] - add file or url to bottom of playlist", # TO DO: Translate + "commandList-notification/playlist": "\tql - show the current playlist", # TO DO: Translate + "commandList-notification/select": "\tqs [index] - select given entry in the playlist", # TO DO: Translate + "commandList-notification/delete": "\tqd [index] - delete the given entry from the playlist", # TO DO: Translate "syncplay-version-notification": "Syncplay Version: {}", # syncplay.version "more-info-notification": "Weitere Informationen auf: {}", # projectURL diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index e286294..b595c32 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -87,6 +87,10 @@ es = { "commandlist-notification/create": "\tc [nombre] - crear sala administrada usando el nombre de la sala actual", "commandlist-notification/auth": "\ta [contraseña] - autentificar como operador de la sala con la contraseña de operador", "commandlist-notification/chat": "\tch [mensaje] - enviar un mensaje en la sala", + "commandList-notification/queue": "\tqa [file/url] - add file or url to bottom of playlist", # TO DO: Translate + "commandList-notification/playlist": "\tql - show the current playlist", # TO DO: Translate + "commandList-notification/select": "\tqs [index] - select given entry in the playlist", # TO DO: Translate + "commandList-notification/delete": "\tqd [index] - delete the given entry from the playlist", # TO DO: Translate "syncplay-version-notification": "Versión de Syncplay: {}", # syncplay.version "more-info-notification": "Más información disponible en: {}", # projectURL diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 9976a63..8782d34 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -87,6 +87,10 @@ it = { "commandlist-notification/create": "\tc [nome] - crea una stanza gestita usando il nome della stanza attuale", "commandlist-notification/auth": "\ta [password] - autentica come gestore della stanza, utilizzando la password del gestore", "commandlist-notification/chat": "\tch [message] - invia un messaggio nella chat della stanza", + "commandList-notification/queue": "\tqa [file/url] - add file or url to bottom of playlist", # TO DO: Translate + "commandList-notification/playlist": "\tql - show the current playlist", # TO DO: Translate + "commandList-notification/select": "\tqs [index] - select given entry in the playlist", # TO DO: Translate + "commandList-notification/delete": "\tqd [index] - delete the given entry from the playlist", # TO DO: Translate "syncplay-version-notification": "Versione di Syncplay: {}", # syncplay.version "more-info-notification": "Maggiori informazioni a: {}", # projectURL diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py index 199be1b..303d48b 100644 --- a/syncplay/messages_pt_BR.py +++ b/syncplay/messages_pt_BR.py @@ -87,6 +87,10 @@ pt_BR = { "commandlist-notification/create": "\tc [nome] - cria sala gerenciado usando o nome da sala atual", "commandlist-notification/auth": "\ta [senha] - autentica-se como operador da sala com a senha", "commandlist-notification/chat": "\tch [mensagem] - envia uma mensagem no chat da sala", + "commandList-notification/queue": "\tqa [file/url] - add file or url to bottom of playlist", # TO DO: Translate + "commandList-notification/playlist": "\tql - show the current playlist", # TO DO: Translate + "commandList-notification/select": "\tqs [index] - select given entry in the playlist", # TO DO: Translate + "commandList-notification/delete": "\tqd [index] - delete the given entry from the playlist", # TO DO: Translate "syncplay-version-notification": "Versão do Syncplay: {}", # syncplay.version "more-info-notification": "Mais informações disponíveis em: {}", # projectURL diff --git a/syncplay/messages_pt_PT.py b/syncplay/messages_pt_PT.py index 1138e76..5682135 100644 --- a/syncplay/messages_pt_PT.py +++ b/syncplay/messages_pt_PT.py @@ -87,6 +87,10 @@ pt_PT = { "commandlist-notification/create": "\tc [nome] - cria sala gerenciada usando o nome da sala atual", "commandlist-notification/auth": "\ta [senha] - autentica-se como administrador da sala com a senha", "commandlist-notification/chat": "\tch [mensagem] - envia uma mensagem no chat da sala", + "commandList-notification/queue": "\tqa [file/url] - add file or url to bottom of playlist", # TO DO: Translate + "commandList-notification/playlist": "\tql - show the current playlist", # TO DO: Translate + "commandList-notification/select": "\tqs [index] - select given entry in the playlist", # TO DO: Translate + "commandList-notification/delete": "\tqd [index] - delete the given entry from the playlist", # TO DO: Translate "syncplay-version-notification": "Versão do Syncplay: {}", # syncplay.version "more-info-notification": "Mais informações disponíveis em: {}", # projectURL diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 225c49e..a1e169b 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -87,6 +87,10 @@ ru = { "commandlist-notification/create": "\tc [name] - создать управляемую комнату с таким же именем, как у текущей", "commandlist-notification/auth": "\ta [password] - авторизоваться как оператор комнаты с помощью пароля", "commandlist-notification/chat": "\tch [message] - send a chat message in a room", # TODO: Translate + "commandList-notification/queue": "\tqa [file/url] - add file or url to bottom of playlist", # TO DO: Translate + "commandList-notification/playlist": "\tql - show the current playlist", # TO DO: Translate + "commandList-notification/select": "\tqs [index] - select given entry in the playlist", # TO DO: Translate + "commandList-notification/delete": "\tqd [index] - delete the given entry from the playlist", # TO DO: Translate "syncplay-version-notification": "Версия Syncplay: {}", # syncplay.version "more-info-notification": "Больше информации на {}", # projectURL From 10981abb88f617fcfc65fdf93fd167aa54a0c87e Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 13 Sep 2020 18:44:16 +0100 Subject: [PATCH 107/112] Tweaks, refactoring and fixes for console improvements (#327) --- syncplay/client.py | 5 ++++- syncplay/messages_de.py | 3 +++ syncplay/messages_en.py | 4 ++++ syncplay/messages_es.py | 3 +++ syncplay/messages_it.py | 3 +++ syncplay/messages_pt_BR.py | 3 +++ syncplay/messages_pt_PT.py | 3 +++ syncplay/messages_ru.py | 3 +++ syncplay/ui/consoleUI.py | 20 +++++++++----------- syncplay/ui/gui.py | 2 +- 10 files changed, 36 insertions(+), 13 deletions(-) diff --git a/syncplay/client.py b/syncplay/client.py index f596ad5..60dc7c6 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -1892,9 +1892,12 @@ class SyncplayPlaylist(): def deleteAtIndex(self, index): new_playlist = self._playlist.copy() - if index < len(new_playlist): + if index >= 0 and index < len(new_playlist): del new_playlist[index] self.changePlaylist(new_playlist) + else: + raise TypeError("Invalid index") + @needsSharedPlaylistsEnabled def undoPlaylistChange(self): diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index b7a7961..10087c7 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -512,4 +512,7 @@ de = { "playlist-instruction-item-message": "Zieh eine Datei hierher, um sie zur geteilten Playlist hinzuzufügen.", "sharedplaylistenabled-tooltip": "Raumleiter können Dateien zu einer geteilten Playlist hinzufügen und es so erleichtern, gemeinsam das Gleiche zu gucken. Konfiguriere Medienverzeichnisse unter „Diverse“", + + "playlist-empty-error": "Playlist is currently empty.", # TO DO: Translate + "playlist-invalid-index-error": "Invalid playlist index", # TO DO: Translate } diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index ed61b42..5d06ea9 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -180,6 +180,7 @@ en = { "load-playlist-from-file-argument": "loads playlist from text file (one entry per line)", + # Client labels "config-window-title": "Syncplay configuration", @@ -512,4 +513,7 @@ en = { "playlist-instruction-item-message": "Drag file here to add it to the shared playlist.", "sharedplaylistenabled-tooltip": "Room operators can add files to a synced playlist to make it easy for everyone to watching the same thing. Configure media directories under 'Misc'.", + + "playlist-empty-error": "Playlist is currently empty.", + "playlist-invalid-index-error": "Invalid playlist index", } diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index b595c32..6696a6b 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -512,4 +512,7 @@ es = { "playlist-instruction-item-message": "Desplazar aquí el archivo para agregarlo a la lista de reproducción compartida.", "sharedplaylistenabled-tooltip": "Los operadores de la sala pueden agregar archivos a una lista de reproducción sincronizada, para que visualizar la misma cosa sea más sencillo para todos. Configurar directorios multimedia en 'Misc'.", + + "playlist-empty-error": "Playlist is currently empty.", # TO DO: Translate + "playlist-invalid-index-error": "Invalid playlist index", # TO DO: Translate } diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 8782d34..3df17f1 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -512,4 +512,7 @@ it = { "playlist-instruction-item-message": "Trascina qui i file per aggiungerli alla playlist condivisa.", "sharedplaylistenabled-tooltip": "Gli operatori della stanza possono aggiungere i file a una playlist sincronizzata per garantire che tutti i partecipanti stiano guardando la stessa cosa. Configura le cartelle multimediali alla voce 'Miscellanea'.", + + "playlist-empty-error": "Playlist is currently empty.", # TO DO: Translate + "playlist-invalid-index-error": "Invalid playlist index", # TO DO: Translate } diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py index 303d48b..bb29dca 100644 --- a/syncplay/messages_pt_BR.py +++ b/syncplay/messages_pt_BR.py @@ -512,4 +512,7 @@ pt_BR = { "playlist-instruction-item-message": "Arraste um arquivo aqui para adicioná-lo à playlist compartilhada.", "sharedplaylistenabled-tooltip": "Operadores da sala podem adicionar arquivos para a playlist compartilhada para tornar mais fácil para todo mundo assistir a mesma coisa. Configure os diretórios de mídia em 'Miscelânea'.", + + "playlist-empty-error": "Playlist is currently empty.", # TO DO: Translate + "playlist-invalid-index-error": "Invalid playlist index", # TO DO: Translate } diff --git a/syncplay/messages_pt_PT.py b/syncplay/messages_pt_PT.py index 5682135..5bfddea 100644 --- a/syncplay/messages_pt_PT.py +++ b/syncplay/messages_pt_PT.py @@ -512,4 +512,7 @@ pt_PT = { "playlist-instruction-item-message": "Arraste um ficheiro aqui para adicioná-lo à playlist compartilhada.", "sharedplaylistenabled-tooltip": "Operadores da sala podem adicionar ficheiros para a playlist compartilhada para tornar mais fácil para todo mundo assistir a mesma coisa. Configure os pastas de mídia em 'Miscelânea'.", + + "playlist-empty-error": "Playlist is currently empty.", # TO DO: Translate + "playlist-invalid-index-error": "Invalid playlist index", # TO DO: Translate } diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index a1e169b..0ac82ea 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -513,4 +513,7 @@ ru = { "playlist-instruction-item-message": "Перетащите сюда файлы, чтобы добавить их в общий список.", "sharedplaylistenabled-tooltip": "Оператор комнаты может добавлять файлы в список общего воспроизведения для удобного совместного просмотра. Папки воспроизведения настраиваются во вкладке 'Файл'.", + + "playlist-empty-error": "Playlist is currently empty.", # TO DO: Translate + "playlist-invalid-index-error": "Invalid playlist index", # TO DO: Translate } diff --git a/syncplay/ui/consoleUI.py b/syncplay/ui/consoleUI.py index f0c463a..700639f 100755 --- a/syncplay/ui/consoleUI.py +++ b/syncplay/ui/consoleUI.py @@ -24,11 +24,6 @@ class ConsoleUI(threading.Thread): self._syncplayClient = client def addFileToPlaylist(self, file): - if not isURL(file): - if not self._syncplayClient.fileSwitch.findFilepath(file): - print(f"{file} is not in any media directory") - return - self._syncplayClient.playlist.addToPlaylist(file) def drop(self): @@ -206,24 +201,27 @@ class ConsoleUI(threading.Thread): if i is not None and i in range(len(playlist_elements)): playlist_elements[i] = " *" + playlist_elements[i] - print(*playlist_elements, sep='\n') + self.showMessage("\n".join(playlist_elements), True) else: - print("playlist is currently empty.") + self.showMessage(getMessage("playlist-empty-error"), True) elif command.group('command') in constants.COMMANDS_SELECT: try: index = int(command.group('parameter').strip()) - 1 + + if index < 0 or index >= len(self._syncplayClient.playlist._playlist): + raise TypeError("Invalid playlist index") self._syncplayClient.playlist.changeToPlaylistIndex(index, resetPosition=True) self._syncplayClient.rewindFile() - except TypeError: - print("invalid index") + except (TypeError, AttributeError): + self.showErrorMessage(getMessage("playlist-invalid-index-error")) elif command.group('command') in constants.COMMANDS_DELETE: try: index = int(command.group('parameter').strip()) - 1 self._syncplayClient.playlist.deleteAtIndex(index) - except TypeError: - print("invalid index") + except (TypeError, AttributeError): + self.showErrorMessage(getMessage("playlist-invalid-index-error")) else: if self._tryAdvancedCommands(data): diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index c2add97..b9423a1 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -1924,7 +1924,7 @@ class MainWindow(QtWidgets.QMainWindow): self.playlist.setPlaylistIndexFilename(filename) def addFileToPlaylist(self, filePath, index=-1): - if not isURL: + if not isURL(filePath): self.removePlaylistNote() filename = os.path.basename(filePath) if self.noPlaylistDuplicates(filename): From 28069a150cd0061f606ab550409f3b73b297e817 Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 13 Sep 2020 18:46:34 +0100 Subject: [PATCH 108/112] Move 'edit room list' up the menu bar order (#336) --- syncplay/ui/gui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index b9423a1..ff05c32 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -1706,6 +1706,10 @@ class MainWindow(QtWidgets.QMainWindow): window.windowMenu = QtWidgets.QMenu(getMessage("window-menu-label"), self) + window.editroomsAction = window.windowMenu.addAction(QtGui.QPixmap(resourcespath + 'door_open_edit.png'), getMessage("roomlist-msgbox-label")) + window.editroomsAction.triggered.connect(self.openEditRoomsDialog) + window.menuBar.addMenu(window.windowMenu) + window.playbackAction = window.windowMenu.addAction(getMessage("playbackbuttons-menu-label")) window.playbackAction.setCheckable(True) window.playbackAction.triggered.connect(self.updatePlaybackFrameVisibility) @@ -1714,9 +1718,6 @@ class MainWindow(QtWidgets.QMainWindow): window.autoplayAction.setCheckable(True) window.autoplayAction.triggered.connect(self.updateAutoplayVisibility) - window.editroomsAction = window.windowMenu.addAction(QtGui.QPixmap(resourcespath + 'door_open_edit.png'), getMessage("roomlist-msgbox-label")) - window.editroomsAction.triggered.connect(self.openEditRoomsDialog) - window.menuBar.addMenu(window.windowMenu) # Help menu From 55b4cfba35ae3d0ed8987070dcb9db2a40d65804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wr=C3=B3bel?= Date: Sun, 13 Sep 2020 20:10:07 +0200 Subject: [PATCH 109/112] Allow PySide2 5.15.1 PySide2 5.15.1 was released, which should fix the external bug causing #321 --- requirements_gui.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements_gui.txt b/requirements_gui.txt index cbdd00c..a51f665 100644 --- a/requirements_gui.txt +++ b/requirements_gui.txt @@ -1,2 +1,2 @@ -pyside2>=5.11.0,<5.15 -requests>=2.20.0; sys_platform == 'darwin' \ No newline at end of file +pyside2>=5.11.0 +requests>=2.20.0; sys_platform == 'darwin' From 92d2d580f9b6cb8085be9be46b5368a288d0e302 Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 13 Sep 2020 19:56:15 +0100 Subject: [PATCH 110/112] Auto save room name by default (optional), make room name list alphabetical --- syncplay/client.py | 6 ++++++ syncplay/messages_de.py | 2 ++ syncplay/messages_en.py | 2 ++ syncplay/messages_es.py | 2 ++ syncplay/messages_it.py | 2 ++ syncplay/messages_pt_BR.py | 2 ++ syncplay/messages_pt_PT.py | 2 ++ syncplay/messages_ru.py | 2 ++ syncplay/ui/ConfigurationGetter.py | 3 +++ syncplay/ui/GuiConfiguration.py | 14 ++++++++++---- syncplay/ui/consoleUI.py | 3 +++ syncplay/ui/gui.py | 19 ++++++++++++++++++- 12 files changed, 54 insertions(+), 5 deletions(-) diff --git a/syncplay/client.py b/syncplay/client.py index 60dc7c6..83060ce 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -534,6 +534,7 @@ class SyncplayClient(object): # TODO: Handle cases where users add www. to start of domain def setRoomList(self, newRoomList): + newRoomList = sorted(newRoomList) from syncplay.ui.ConfigurationGetter import ConfigurationGetter ConfigurationGetter().setConfigOption("roomList", newRoomList) oldRoomList = self._config['roomList'] @@ -1041,6 +1042,8 @@ class SyncplayClient(object): def storeControlPassword(self, room, password): if password: self.controlpasswords[room] = password + if self._config['autosaveJoinsToList']: + self.ui.addRoomToList(room+":"+password) def getControlledRoomPassword(self, room): if room in self.controlpasswords: @@ -1637,6 +1640,9 @@ class UiManager(object): def updateRoomName(self, room=""): self.__ui.updateRoomName(room) + def addRoomToList(self, room): + self.__ui.addRoomToList(room) + def executeCommand(self, command): self.__ui.executeCommand(command) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 10087c7..802e379 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -392,6 +392,8 @@ de = { "privacy-sendhashed-tooltip": "Die Informationen gehasht übertragen, um sie für andere Clients schwerer lesbar zu machen.", "privacy-dontsend-tooltip": "Diese Information nicht übertragen. Dies garantiert den größtmöglichen Datanschutz.", "checkforupdatesautomatically-tooltip": "Regelmäßig auf der Syncplay-Website nach Updates suchen.", + "autosavejoinstolist-tooltip": "When you join a room in a server, automatically remember the room name in the list of rooms to join.", # TO DO: Translate + "autosavejoinstolist-label": "Add rooms you join to the room list e", # TO DO: Translate "slowondesync-tooltip": "Reduziert die Abspielgeschwindigkeit zeitweise, um die Synchronität zu den anderen Clients wiederherzustellen.", "rewindondesync-label": "Zurückspulen bei großer Zeitdifferenz (empfohlen)", "fastforwardondesync-label": "Vorspulen wenn das Video laggt (empfohlen)", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 5d06ea9..243c1ad 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -207,6 +207,7 @@ en = { "filename-privacy-label": "Filename information:", "filesize-privacy-label": "File size information:", "checkforupdatesautomatically-label": "Check for Syncplay updates automatically", + "autosavejoinstolist-label": "Add rooms you join to the room list", "slowondesync-label": "Slow down on minor desync (not supported on MPC-HC/BE)", "rewindondesync-label": "Rewind on major desync (recommended)", "fastforwardondesync-label": "Fast-forward if lagging behind (recommended)", @@ -394,6 +395,7 @@ en = { "privacy-sendhashed-tooltip": "Send a hashed version of the information, making it less visible to other clients.", "privacy-dontsend-tooltip": "Do not send this information to the server. This provides for maximum privacy.", "checkforupdatesautomatically-tooltip": "Regularly check with the Syncplay website to see whether a new version of Syncplay is available.", + "autosavejoinstolist-tooltip": "When you join a room in a server, automatically remember the room name in the list of rooms to join.", "slowondesync-tooltip": "Reduce playback rate temporarily when needed to bring you back in sync with other viewers. Not supported on MPC-HC/BE.", "dontslowdownwithme-tooltip": "Means others do not get slowed down or rewinded if your playback is lagging. Useful for room operators.", "pauseonleave-tooltip": "Pause playback if you get disconnected or someone leaves from your room.", diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index 6696a6b..b705f98 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -206,6 +206,7 @@ es = { "filename-privacy-label": "Información del nombre de archivo:", "filesize-privacy-label": "Información del tamaño de archivo:", "checkforupdatesautomatically-label": "Buscar actualizaciones de Syncplay automáticamente", + "autosavejoinstolist-label": "Add rooms you join to the room list", # TO DO: Translate "slowondesync-label": "Ralentizar si hay una desincronización menor (no soportado en MPC-HC/BE)", "rewindondesync-label": "Rebobinar si hay una desincronización mayor (recomendado)", "fastforwardondesync-label": "Avanzar rápidamente si hay un retraso (recomendado)", @@ -393,6 +394,7 @@ es = { "privacy-sendhashed-tooltip": "Enviar una versión \"hasheada\" de la información, para que sea menos visible para otros clientes.", "privacy-dontsend-tooltip": "No enviar esta información al servidor. Esto proporciona la máxima privacidad.", "checkforupdatesautomatically-tooltip": "Regularmente verificar con el sitio Web de Syncplay para ver si hay una nueva versión de Syncplay disponible.", + "autosavejoinstolist-tooltip": "When you join a room in a server, automatically remember the room name in the list of rooms to join.", # TO DO: Translate "slowondesync-tooltip": "Reducir la velocidad de reproducción temporalmente cuando sea necesario, para volver a sincronizar con otros espectadores. No soportado en MPC-HC/BE.", "dontslowdownwithme-tooltip": "Significa que otros no se ralentizan ni rebobinan si la reproducción se retrasa. Útil para operadores de la sala.", "pauseonleave-tooltip": "Pausa la reproducción si te desconectas o alguien sale de tu sala.", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 3df17f1..028bb11 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -206,6 +206,7 @@ it = { "filename-privacy-label": "Nome del file:", "filesize-privacy-label": "Dimensione del file:", "checkforupdatesautomatically-label": "Controlla automaticamente gli aggiornamenti di Syncplay", + "autosavejoinstolist-label": "Add rooms you join to the room list", # TO DO: Translate "slowondesync-label": "Rallenta in caso di sfasamento minimo (non supportato su MPC-HC/BE)", "rewindondesync-label": "Riavvolgi in caso di grande sfasamento (consigliato)", "fastforwardondesync-label": "Avanzamento rapido in caso di ritardo (consigliato)", @@ -393,6 +394,7 @@ it = { "privacy-sendhashed-tooltip": "Invia una versione cifrata dell'informazione, rendendola meno visibile agli altri client.", "privacy-dontsend-tooltip": "Non inviare questa informazione al server. Questo garantisce massima privacy.", "checkforupdatesautomatically-tooltip": "Controlla regolarmente la presenza di nuove versioni di Syncplay.", + "autosavejoinstolist-tooltip": "When you join a room in a server, automatically remember the room name in the list of rooms to join.", # TO DO: Translate "slowondesync-tooltip": "Riduce temporaneamente la velocità di riproduzione quando c'è bisogno di sincronizzarti con gli altri utenti. Non supportato su MPC-HC/BE.", "dontslowdownwithme-tooltip": "Gli altri utenti non vengono rallentati se non sei sincronizzato. Utile per i gestori della stanza.", "pauseonleave-tooltip": "Mette in pausa la riproduzione se vieni disconnesso o se qualcuno lascia la stanza.", diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py index bb29dca..7f85976 100644 --- a/syncplay/messages_pt_BR.py +++ b/syncplay/messages_pt_BR.py @@ -206,6 +206,7 @@ pt_BR = { "filename-privacy-label": "Informação do nome do arquivo:", "filesize-privacy-label": "Informação do tamanho do arquivo:", "checkforupdatesautomatically-label": "Verificar atualizações do Syncplay automaticamente", + "autosavejoinstolist-label": "Add rooms you join to the room list", # TO DO: Translate "slowondesync-label": "Diminuir velocidade em dessincronizações menores (não suportado pelo MPC-HC/BE)", "rewindondesync-label": "Retroceder em dessincronização maiores (recomendado)", "fastforwardondesync-label": "Avançar se estiver ficando para trás (recomendado)", @@ -393,6 +394,7 @@ pt_BR = { "privacy-sendhashed-tooltip": "Mandar versão hasheada da informação, tornando-a menos visível aos outros clients.", "privacy-dontsend-tooltip": "Não enviar esta informação ao servidor. Esta opção oferece a maior privacidade.", "checkforupdatesautomatically-tooltip": "Checar o site do Syncplay regularmente para ver se alguma nova versão do Syncplay está disponível.", + "autosavejoinstolist-tooltip": "When you join a room in a server, automatically remember the room name in the list of rooms to join.", # TO DO: Translate "slowondesync-tooltip": "Reduzir a velocidade de reprodução temporariamente quando necessário para trazer você de volta à sincronia com os outros espectadores. Não suportado pelo MPC-HC/BE.", "dontslowdownwithme-tooltip": "Significa que outros não serão desacelerados ou retrocedidos se sua reprodução estiver ficando para trás. Útil para operadores de salas.", "pauseonleave-tooltip": "Pausar reprodução se você for disconectado ou se alguém sair da sua sala.", diff --git a/syncplay/messages_pt_PT.py b/syncplay/messages_pt_PT.py index 5bfddea..f0fb92b 100644 --- a/syncplay/messages_pt_PT.py +++ b/syncplay/messages_pt_PT.py @@ -393,6 +393,8 @@ pt_PT = { "privacy-sendhashed-tooltip": "Mandar versão hasheada da informação, tornando-a menos visível aos outros clients.", "privacy-dontsend-tooltip": "Não enviar esta informação ao servidor. Esta opção oferece a maior privacidade.", "checkforupdatesautomatically-tooltip": "Verificar o site do Syncplay regularmente para ver se alguma nova versão do Syncplay está disponível.", + "autosavejoinstolist-tooltip": "When you join a room in a server, automatically remember the room name in the list of rooms to join.", # TO DO: Translate + "autosavejoinstolist-label": "Add rooms you join to the room list", # TO DO: Translate "slowondesync-tooltip": "Reduzir a velocidade de reprodução temporariamente quando necessário para trazer você de volta à sincronia com os outros espectadores. Não suportado pelo MPC-HC/BE.", "dontslowdownwithme-tooltip": "Significa que outros não serão desacelerados ou retrocedidos se sua reprodução estiver ficando para trás. Útil para administradores de salas.", "pauseonleave-tooltip": "Pausar reprodução se você for disconectado ou se alguém sair da sua sala.", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 0ac82ea..242abcc 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -207,6 +207,7 @@ ru = { "filename-privacy-label": "Имя файла:", "filesize-privacy-label": "Размер файла:", "checkforupdatesautomatically-label": "Проверять обновления автоматически", + "autosavejoinstolist-label": "Add rooms you join to the room list", # TO DO: Translate "slowondesync-label": "Замедлять при небольших рассинхронизациях (не поддерживаетя в MPC-HC/BE)", "rewindondesync-label": "Перемотка при больших рассинхронизациях (настоятельно рекомендуется)", "dontslowdownwithme-label": "Никогда не замедлять и не перематывать видео другим (функция тестируется)", @@ -396,6 +397,7 @@ ru = { "privacy-sendhashed-tooltip": "Отправляет хэш-сумму этой информации, делая ее невидимой для других пользователей.", "privacy-dontsend-tooltip": "Не отправлять эту информацию на сервер. Предоставляет наибольшую приватность.", "checkforupdatesautomatically-tooltip": "Syncplay будет регулярно заходить на сайт и проверять наличие новых версий.", + "autosavejoinstolist-tooltip": "When you join a room in a server, automatically remember the room name in the list of rooms to join.", # TO DO: Translate "slowondesync-tooltip": "Временно уменьшить скорость воспроизведения в целях синхронизации с другими зрителями. Не поддерживается в MPC-HC/BE.", "dontslowdownwithme-tooltip": "Ваши лаги не будут влиять на других зрителей.", "pauseonleave-tooltip": "Приостановить воспроизведение, если Вы покинули комнату или кто-то из зрителей отключился от сервера.", diff --git a/syncplay/ui/ConfigurationGetter.py b/syncplay/ui/ConfigurationGetter.py index dac9290..dd1d8ec 100755 --- a/syncplay/ui/ConfigurationGetter.py +++ b/syncplay/ui/ConfigurationGetter.py @@ -38,6 +38,7 @@ class ConfigurationGetter(object): "loopAtEndOfPlaylist": False, "loopSingleFiles": False, "onlySwitchToTrustedDomains": True, + "autosaveJoinsToList": True, "trustedDomains": constants.DEFAULT_TRUSTED_DOMAINS, "file": None, "playerArgs": [], @@ -137,6 +138,7 @@ class ConfigurationGetter(object): "loopAtEndOfPlaylist", "loopSingleFiles", "onlySwitchToTrustedDomains", + "autosaveJoinsToList", "chatInputEnabled", "chatInputFontUnderline", "chatDirectInput", @@ -196,6 +198,7 @@ class ConfigurationGetter(object): "loopSingleFiles", "onlySwitchToTrustedDomains", "trustedDomains", "publicServers"], "gui": [ + "autosaveJoinsToList", "showOSD", "showOSDWarnings", "showSlowdownOSD", "showDifferentRoomOSD", "showSameRoomOSD", "showNonControllerOSD", "showDurationNotification", diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index 70287eb..9691581 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -178,6 +178,7 @@ class ConfigDialog(QtWidgets.QDialog): result = RoomsDialog.exec_() if result == QtWidgets.QDialog.Accepted: newRooms = utils.convertMultilineStringToList(RoomsTextbox.toPlainText()) + newRooms = sorted(newRooms) self.relistRoomList(newRooms) def safenormcaseandpath(self, path): @@ -422,9 +423,9 @@ class ConfigDialog(QtWidgets.QDialog): if not newRoom: return roomList = self.config['roomList'] - if newRoom in roomList: - roomList.remove(newRoom) - roomList.insert(0, newRoom) + if newRoom not in roomList: + roomList.append(newRoom) + roomList = sorted(roomList) self.config['roomList'] = roomList def showErrorMessage(self, errorMessage): @@ -495,6 +496,8 @@ class ConfigDialog(QtWidgets.QDialog): self.config['file'] = str(self.mediapathTextbox.text()) self.config['publicServers'] = self.publicServerAddresses self.config['room'] = self.roomsCombobox.currentText() + if self.config['autosaveJoinsToList']: + self.addRoomToList(self.config['room']) self.pressedclosebutton = False self.close() @@ -649,7 +652,6 @@ class ConfigDialog(QtWidgets.QDialog): self.serverpassLabel = QLabel(getMessage("password-label"), self) self.roomsCombobox = QtWidgets.QComboBox(self) self.roomsCombobox.setEditable(True) - # self.addRoomToHistory(config['room']) - TO DO: Make this optional self.fillRoomsCombobox() self.roomsCombobox.setEditText(config['room']) self.usernameLabel = QLabel(getMessage("name-label"), self) @@ -893,6 +895,10 @@ class ConfigDialog(QtWidgets.QDialog): self.automaticupdatesCheckbox.setObjectName("checkForUpdatesAutomatically") self.internalSettingsLayout.addWidget(self.automaticupdatesCheckbox) + self.autosaveJoinsToListCheckbox = QCheckBox(getMessage("autosavejoinstolist-label")) + self.autosaveJoinsToListCheckbox.setObjectName("autosaveJoinsToList") + self.internalSettingsLayout.addWidget(self.autosaveJoinsToListCheckbox) + ## Media path directories self.mediasearchSettingsGroup = QtWidgets.QGroupBox(getMessage("syncplay-mediasearchdirectories-title")) diff --git a/syncplay/ui/consoleUI.py b/syncplay/ui/consoleUI.py index 700639f..c9d4473 100755 --- a/syncplay/ui/consoleUI.py +++ b/syncplay/ui/consoleUI.py @@ -89,6 +89,9 @@ class ConsoleUI(threading.Thread): def userListChange(self): pass + def addRoomToList(self): + pass + def fileSwitchFoundFiles(self): pass diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index ff05c32..a5c324a 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -53,7 +53,7 @@ class ConsoleInGUI(ConsoleUI): def showErrorMessage(self, message, criticalerror=False): self._syncplayClient.ui.showErrorMessage(message, criticalerror) - def updateRoomName(self, room=""): + def updateRoomName(self, room=""): #bob self._syncplayClient.ui.updateRoomName(room) def getUserlist(self): @@ -467,6 +467,18 @@ class MainWindow(QtWidgets.QMainWindow): self.roomsCombobox.addItem(roomListValue) self.roomsCombobox.setEditText(previousRoomSelection) + def addRoomToList(self, newRoom=None): + if newRoom is None: + newRoom = self.roomsCombobox.currentText() + if not newRoom: + return + roomList = self.config['roomList'] + if newRoom not in roomList: + roomList.append(newRoom) + self.config['roomList'] = roomList + roomList = sorted(roomList) + self._syncplayClient.setRoomList(roomList) + self.relistRoomList(roomList) def addClient(self, client): self._syncplayClient = client @@ -879,6 +891,8 @@ class MainWindow(QtWidgets.QMainWindow): def updateRoomName(self, room=""): self.roomsCombobox.setEditText(room) + if self.config['autosaveJoinsToList']: + self.addRoomToList(room) def showDebugMessage(self, message): print(message) @@ -909,6 +923,8 @@ class MainWindow(QtWidgets.QMainWindow): if room != self._syncplayClient.getRoom(): self._syncplayClient.setRoom(room, resetAutoplay=True) self._syncplayClient.sendRoom() + if self.config['autosaveJoinsToList']: + self.addRoomToList(room) def seekPositionDialog(self): seekTime, ok = QtWidgets.QInputDialog.getText( @@ -1153,6 +1169,7 @@ class MainWindow(QtWidgets.QMainWindow): result = RoomsDialog.exec_() if result == QtWidgets.QDialog.Accepted: newRooms = utils.convertMultilineStringToList(RoomsTextbox.toPlainText()) + newRooms = sorted(newRooms) self.relistRoomList(newRooms) self._syncplayClient.setRoomList(newRooms) From 4dd09c9de3acfc1e90b56a4886c7afa563b4b81f Mon Sep 17 00:00:00 2001 From: et0h Date: Sun, 13 Sep 2020 20:02:37 +0100 Subject: [PATCH 111/112] Fix issue with telling player to load delayedPath before it is ready (#352) --- syncplay/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/syncplay/client.py b/syncplay/client.py index 83060ce..202cd3f 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -1702,6 +1702,11 @@ class SyncplayPlaylist(): def loadDelayedPath(self, changeToIndex): # Implementing the behaviour set out at https://github.com/Syncplay/syncplay/issues/315 + + if self._client.playerIsNotReady(): + self._client.addPlayerReadyCallback(lambda x: self.loadDelayedPath(changeToIndex)) + return + if self._client._protocol.hadFirstPlaylistIndex and self._client.delayedLoadPath: delayedLoadPath = str(self._client.delayedLoadPath) self._client.delayedLoadPath = None From f7ca631e08564db92508b183fa81622c4df16fcd Mon Sep 17 00:00:00 2001 From: et0h Date: Thu, 17 Sep 2020 20:57:29 +0100 Subject: [PATCH 112/112] Allow = sign in value of command line options (#333) --- syncplay/players/mpv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index 33f02a9..3971f83 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -65,7 +65,7 @@ class MpvPlayer(BasePlayer): if argToAdd.strip() == "": continue if "=" in argToAdd: - (argName, argValue) = argToAdd.split("=") + (argName, argValue) = argToAdd.split("=", 1) else: argName = argToAdd argValue = "yes"