Merge branch 'master' into setOthersReadiness
This commit is contained in:
commit
bd9d233372
@ -16,7 +16,7 @@ Version: "$(
|
|||||||
)"
|
)"
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Maintainer: <dev@syncplay.pl>
|
Maintainer: <dev@syncplay.pl>
|
||||||
Depends: python3 (>= 3.6), python3-pyside2.qtwidgets, python3-pyside2.qtcore, python3-twisted (>= 16.4.0), python3-certifi, mpv (>= 0.23) | vlc (>= 2.2.1)
|
Depends: python3 (>= 3.6), python3-pyside2.qtwidgets | python3-pyside6.qtwidgets, python3-pyside2.qtcore | python3-pyside6.qtcore, python3-twisted (>= 16.4.0), python3-certifi, python3-pem, mpv (>= 0.23) | vlc (>= 2.2.1)
|
||||||
Homepage: https://syncplay.pl
|
Homepage: https://syncplay.pl
|
||||||
Section: web
|
Section: web
|
||||||
Priority: optional
|
Priority: optional
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
version = '1.7.2'
|
version = '1.7.4'
|
||||||
revision = ' development'
|
revision = ' development'
|
||||||
milestone = 'Yoitsu'
|
milestone = 'Yoitsu'
|
||||||
release_number = '110'
|
release_number = '113'
|
||||||
projectURL = 'https://syncplay.pl/'
|
projectURL = 'https://syncplay.pl/'
|
||||||
|
|||||||
@ -71,6 +71,9 @@ class SyncplayClient(object):
|
|||||||
constants.SHOW_SAME_ROOM_OSD = config['showSameRoomOSD']
|
constants.SHOW_SAME_ROOM_OSD = config['showSameRoomOSD']
|
||||||
constants.SHOW_DURATION_NOTIFICATION = config['showDurationNotification']
|
constants.SHOW_DURATION_NOTIFICATION = config['showDurationNotification']
|
||||||
constants.DEBUG_MODE = config['debug']
|
constants.DEBUG_MODE = config['debug']
|
||||||
|
constants.FOLDER_SEARCH_FIRST_FILE_TIMEOUT = config['folderSearchFirstFileTimeout']
|
||||||
|
constants.FOLDER_SEARCH_TIMEOUT = config['folderSearchTimeout']
|
||||||
|
constants.FOLDER_SEARCH_DOUBLE_CHECK_INTERVAL = config['folderSearchDoubleCheckInterval']
|
||||||
|
|
||||||
self.controlpasswords = {}
|
self.controlpasswords = {}
|
||||||
self.lastControlPasswordAttempt = None
|
self.lastControlPasswordAttempt = None
|
||||||
@ -1795,6 +1798,9 @@ class SyncplayPlaylist():
|
|||||||
def loadDelayedPath(self, changeToIndex):
|
def loadDelayedPath(self, changeToIndex):
|
||||||
# Implementing the behaviour set out at https://github.com/Syncplay/syncplay/issues/315
|
# Implementing the behaviour set out at https://github.com/Syncplay/syncplay/issues/315
|
||||||
|
|
||||||
|
if not self._client:
|
||||||
|
return
|
||||||
|
|
||||||
if self._client.playerIsNotReady():
|
if self._client.playerIsNotReady():
|
||||||
self._client.addPlayerReadyCallback(lambda x: self.loadDelayedPath(changeToIndex))
|
self._client.addPlayerReadyCallback(lambda x: self.loadDelayedPath(changeToIndex))
|
||||||
return
|
return
|
||||||
|
|||||||
@ -29,7 +29,7 @@ MPLAYER_OSD_LEVEL = 1
|
|||||||
UI_TIME_FORMAT = "[%X] "
|
UI_TIME_FORMAT = "[%X] "
|
||||||
CONFIG_NAMES = [".syncplay", "syncplay.ini"] # Syncplay searches first to last
|
CONFIG_NAMES = [".syncplay", "syncplay.ini"] # Syncplay searches first to last
|
||||||
DEFAULT_CONFIG_NAME = "syncplay.ini"
|
DEFAULT_CONFIG_NAME = "syncplay.ini"
|
||||||
RECENT_CLIENT_THRESHOLD = "1.7.1" # This and higher considered 'recent' clients (no warnings)
|
RECENT_CLIENT_THRESHOLD = "1.7.3" # This and higher considered 'recent' clients (no warnings)
|
||||||
MUSIC_FORMATS = [".mp3", ".m4a", ".m4p", ".wav", ".aiff", ".r", ".ogg", ".flac"] # ALL LOWER CASE!
|
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
|
WARN_OLD_CLIENTS = True # Use MOTD to inform old clients to upgrade
|
||||||
LIST_RELATIVE_CONFIGS = True # Print list of relative configs loaded
|
LIST_RELATIVE_CONFIGS = True # Print list of relative configs loaded
|
||||||
@ -112,9 +112,9 @@ FOLDER_SEARCH_DOUBLE_CHECK_INTERVAL = 30.0 # Secs - Frequency of updating cache
|
|||||||
# Usually there's no need to adjust these
|
# Usually there's no need to adjust these
|
||||||
DOUBLE_CHECK_REWIND = False
|
DOUBLE_CHECK_REWIND = False
|
||||||
LAST_PAUSED_DIFF_THRESHOLD = 2
|
LAST_PAUSED_DIFF_THRESHOLD = 2
|
||||||
FILENAME_STRIP_REGEX = "[-~_\.\[\](): ]"
|
FILENAME_STRIP_REGEX = r"[-~_\.\[\](): ]"
|
||||||
CONTROL_PASSWORD_STRIP_REGEX = "[^a-zA-Z0-9\-]"
|
CONTROL_PASSWORD_STRIP_REGEX = r"[^a-zA-Z0-9\-]"
|
||||||
ROOM_NAME_STRIP_REGEX = "^(\+)(?P<roomnamebase>.*)(:)(\w{12})$"
|
ROOM_NAME_STRIP_REGEX = r"^(\+)(?P<roomnamebase>.*)(:)(\w{12})$"
|
||||||
ARGUMENT_SPLIT_REGEX = r'(?:[^\s"]+|"[^"]*")+'
|
ARGUMENT_SPLIT_REGEX = r'(?:[^\s"]+|"[^"]*")+'
|
||||||
COMMANDS_UNDO = ["u", "undo", "revert"]
|
COMMANDS_UNDO = ["u", "undo", "revert"]
|
||||||
COMMANDS_CHAT = ["ch", "chat"]
|
COMMANDS_CHAT = ["ch", "chat"]
|
||||||
@ -166,7 +166,7 @@ MPC_PATHS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
MPC_EXECUTABLES = ["mpc-hc.exe", "mpc-hc64.exe", "mpc-hcportable.exe", "mpc-hc_nvo.exe", "mpc-hc64_nvo.exe", "shoukaku.exe"]
|
MPC_EXECUTABLES = ["mpc-hc.exe", "mpc-hc64.exe", "mpc-hcportable.exe", "mpc-hc_nvo.exe", "mpc-hc64_nvo.exe", "shoukaku.exe"]
|
||||||
MPC64_EXECUTABLES = ["mpc-hc64.exe", "mpc-hc64_nvo.exe", "x64\mpc-hc\shoukaku.exe"]
|
MPC64_EXECUTABLES = ["mpc-hc64.exe", "mpc-hc64_nvo.exe", r"x64\mpc-hc\shoukaku.exe"]
|
||||||
|
|
||||||
MPC_BE_PATHS = [
|
MPC_BE_PATHS = [
|
||||||
r"c:\program files\mpc-be x64\mpc-be64.exe",
|
r"c:\program files\mpc-be x64\mpc-be64.exe",
|
||||||
@ -183,6 +183,7 @@ try:
|
|||||||
import os
|
import os
|
||||||
MPVNET_PATHS.append(os.path.expandvars(r'%LOCALAPPDATA%\Microsoft\WindowsApps\mpvnet.exe'))
|
MPVNET_PATHS.append(os.path.expandvars(r'%LOCALAPPDATA%\Microsoft\WindowsApps\mpvnet.exe'))
|
||||||
MPVNET_PATHS.append(os.path.expandvars(r'%LOCALAPPDATA%\Programs\mpv.net\mpvnet.exe'))
|
MPVNET_PATHS.append(os.path.expandvars(r'%LOCALAPPDATA%\Programs\mpv.net\mpvnet.exe'))
|
||||||
|
MPV_PATHS.append(os.path.expandvars(r'%LOCALAPPDATA%\Microsoft\WindowsApps\mpv.exe'))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
VLC_PATHS = [
|
VLC_PATHS = [
|
||||||
@ -305,7 +306,7 @@ VLC_SLAVE_EXTRA_ARGS = getValueForOS({
|
|||||||
OS_MACOS: ['--verbose=2', '--no-file-logging']})
|
OS_MACOS: ['--verbose=2', '--no-file-logging']})
|
||||||
MPV_SUPERSEDE_IF_DUPLICATE_COMMANDS = ["set_property time-pos ", "loadfile "]
|
MPV_SUPERSEDE_IF_DUPLICATE_COMMANDS = ["set_property time-pos ", "loadfile "]
|
||||||
MPV_REMOVE_BOTH_IF_DUPLICATE_COMMANDS = ["cycle pause"]
|
MPV_REMOVE_BOTH_IF_DUPLICATE_COMMANDS = ["cycle pause"]
|
||||||
MPLAYER_ANSWER_REGEX = "^ANS_([a-zA-Z_-]+)=(.+)$|^(Exiting)\.\.\. \((.+)\)$"
|
MPLAYER_ANSWER_REGEX = r"^ANS_([a-zA-Z_-]+)=(.+)$|^(Exiting)\.\.\. \((.+)\)$"
|
||||||
VLC_ANSWER_REGEX = r"(?:^(?P<command>[a-zA-Z_-]+)(?:\: )?(?P<argument>.*))"
|
VLC_ANSWER_REGEX = r"(?:^(?P<command>[a-zA-Z_-]+)(?:\: )?(?P<argument>.*))"
|
||||||
UI_COMMAND_REGEX = r"^(?P<command>[^\ ]+)(?:\ (?P<parameter>.+))?"
|
UI_COMMAND_REGEX = r"^(?P<command>[^\ ]+)(?:\ (?P<parameter>.+))?"
|
||||||
UI_OFFSET_REGEX = r"^(?:o|offset)\ ?(?P<sign>[/+-])?(?P<time>\d{1,9}(?:[^\d\.](?:\d{1,9})){0,2}(?:\.(?:\d{1,3}))?)$"
|
UI_OFFSET_REGEX = r"^(?:o|offset)\ ?(?P<sign>[/+-])?(?P<time>\d{1,9}(?:[^\d\.](?:\d{1,9})){0,2}(?:\.(?:\d{1,3}))?)$"
|
||||||
|
|||||||
@ -138,7 +138,7 @@ de = {
|
|||||||
"hostname-empty-error": "Hostname darf nicht leer sein",
|
"hostname-empty-error": "Hostname darf nicht leer sein",
|
||||||
"empty-error": "{} darf nicht leer sein", # Configuration
|
"empty-error": "{} darf nicht leer sein", # Configuration
|
||||||
"media-player-error": "Player-Fehler: \"{}\"", # Error line
|
"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-gui-error": "Konnte die GUI-Bibliotheken nicht importieren. PySide muss installiert sein, damit die grafische Oberfläche funktioniert. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work."
|
||||||
"unable-import-twisted-error": "Twisted konnte nicht importiert werden. Bitte installiere Twisted v16.4.0 oder höher",
|
"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",
|
"arguments-missing-error": "Notwendige Argumente fehlen, siehe --help",
|
||||||
|
|||||||
@ -138,7 +138,7 @@ en = {
|
|||||||
"hostname-empty-error": "Hostname can't be empty",
|
"hostname-empty-error": "Hostname can't be empty",
|
||||||
"empty-error": "{} can't be empty", # Configuration
|
"empty-error": "{} can't be empty", # Configuration
|
||||||
"media-player-error": "Media player error: \"{}\"", # Error line
|
"media-player-error": "Media player error: \"{}\"", # Error line
|
||||||
"unable-import-gui-error": "Could not import GUI libraries. If you do not have PySide installed then you will need to install it for the GUI to work.",
|
"unable-import-gui-error": "Could not import GUI libraries. You need to have the correct version of PySide installed for the GUI to work. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.",
|
||||||
"unable-import-twisted-error": "Could not import Twisted. Please install Twisted v16.4.0 or later.",
|
"unable-import-twisted-error": "Could not import Twisted. Please install Twisted v16.4.0 or later.",
|
||||||
|
|
||||||
"arguments-missing-error": "Some necessary arguments are missing, refer to --help",
|
"arguments-missing-error": "Some necessary arguments are missing, refer to --help",
|
||||||
|
|||||||
@ -141,7 +141,7 @@ eo = {
|
|||||||
"hostname-empty-error": "Nomo de gastiga komputilo ne povas esti malplena",
|
"hostname-empty-error": "Nomo de gastiga komputilo ne povas esti malplena",
|
||||||
"empty-error": "{} ne povas esti malplena", # Configuration
|
"empty-error": "{} ne povas esti malplena", # Configuration
|
||||||
"media-player-error": "Eraro de vidaŭdaĵa ludilo: \"{}\"", # Error line
|
"media-player-error": "Eraro de vidaŭdaĵa ludilo: \"{}\"", # Error line
|
||||||
"unable-import-gui-error": "Ne povis enporti fasadajn bibliotekojn. Se PySide ne estas instalita, vi devos instali ĝin, por ke la fasado funkciu.",
|
"unable-import-gui-error": "Ne povis enporti fasadajn bibliotekojn. Se PySide ne estas instalita, vi devos instali ĝin, por ke la fasado funkciu. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work."
|
||||||
"unable-import-twisted-error": "Ne povis enporti la bibliotekon Twisted. Bonvolu instali version 16.4.0 de Twisted, aŭ pli altan.",
|
"unable-import-twisted-error": "Ne povis enporti la bibliotekon Twisted. Bonvolu instali version 16.4.0 de Twisted, aŭ pli altan.",
|
||||||
|
|
||||||
"arguments-missing-error": "Iuj bezonataj parametroj mankas; vidu al --help",
|
"arguments-missing-error": "Iuj bezonataj parametroj mankas; vidu al --help",
|
||||||
|
|||||||
@ -138,7 +138,7 @@ es = {
|
|||||||
"hostname-empty-error": "El nombre del host no puede ser vacío",
|
"hostname-empty-error": "El nombre del host no puede ser vacío",
|
||||||
"empty-error": "{} no puede ser vacío", # Configuration
|
"empty-error": "{} no puede ser vacío", # Configuration
|
||||||
"media-player-error": "Error del reproductor multimedia: \"{}\"", # Error line
|
"media-player-error": "Error del reproductor multimedia: \"{}\"", # Error line
|
||||||
"unable-import-gui-error": "No se lograron importar las librerías GUI. Si no tienes instalado PySide, entonces tendrás que instalarlo para que funcione el GUI.",
|
"unable-import-gui-error": "No se lograron importar las librerías GUI. Si no tienes instalado PySide, entonces tendrás que instalarlo para que funcione el GUI. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work."
|
||||||
"unable-import-twisted-error": "No se logró importar Twisted. Por favor instala Twisted v16.4.0 o posterior.",
|
"unable-import-twisted-error": "No se logró importar Twisted. Por favor instala Twisted v16.4.0 o posterior.",
|
||||||
|
|
||||||
"arguments-missing-error": "Están faltando algunos argumentos necesarios. Por favor revisa --help",
|
"arguments-missing-error": "Están faltando algunos argumentos necesarios. Por favor revisa --help",
|
||||||
|
|||||||
@ -138,7 +138,7 @@ fi = {
|
|||||||
"hostname-empty-error": "Palvelinnimi ei voi olla tyhjä",
|
"hostname-empty-error": "Palvelinnimi ei voi olla tyhjä",
|
||||||
"empty-error": "{} ei voi jättää tyhjäksi", # Configuration
|
"empty-error": "{} ei voi jättää tyhjäksi", # Configuration
|
||||||
"media-player-error": "Mediasoitin kohtasi virheen: \"{}\"", # Error line
|
"media-player-error": "Mediasoitin kohtasi virheen: \"{}\"", # Error line
|
||||||
"unable-import-gui-error": "Käyttöliittymäkirjastoja ei saatu tuotua. Mikäli sinulla ei ole PySide asennettuna, tulee sinun asentaa se jotta käyttöliittymä toimisi.",
|
"unable-import-gui-error": "Käyttöliittymäkirjastoja ei saatu tuotua. Mikäli sinulla ei ole PySide asennettuna, tulee sinun asentaa se jotta käyttöliittymä toimisi. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work."
|
||||||
"unable-import-twisted-error": "Twisted:iä ei onnistuttu tuomaan. Asenna Twisted v16.4.0 tai myöhäisempi.",
|
"unable-import-twisted-error": "Twisted:iä ei onnistuttu tuomaan. Asenna Twisted v16.4.0 tai myöhäisempi.",
|
||||||
|
|
||||||
"arguments-missing-error": "Joitakin vipuja uupuu, katso apua --help",
|
"arguments-missing-error": "Joitakin vipuja uupuu, katso apua --help",
|
||||||
|
|||||||
@ -138,7 +138,7 @@ fr = {
|
|||||||
"hostname-empty-error": "Le nom d'hôte ne peut pas être vide",
|
"hostname-empty-error": "Le nom d'hôte ne peut pas être vide",
|
||||||
"empty-error": "{} ne peut pas être vide", # Configuration
|
"empty-error": "{} ne peut pas être vide", # Configuration
|
||||||
"media-player-error": "Media player error: \"{}\"", # Error line
|
"media-player-error": "Media player error: \"{}\"", # Error line
|
||||||
"unable-import-gui-error": "Impossible d'importer les bibliothèques GUI. Si vous n'avez pas installé PySide, vous devrez l'installer pour que l'interface graphique fonctionne.",
|
"unable-import-gui-error": "Impossible d'importer les bibliothèques GUI. Si vous n'avez pas installé PySide, vous devrez l'installer pour que l'interface graphique fonctionne. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work."
|
||||||
"unable-import-twisted-error": "Impossible d'importer Twisted. Veuillez installer Twisted v16.4.0 ou une version ultérieure.",
|
"unable-import-twisted-error": "Impossible d'importer Twisted. Veuillez installer Twisted v16.4.0 ou une version ultérieure.",
|
||||||
|
|
||||||
"arguments-missing-error": "Certains arguments nécessaires sont manquants, reportez-vous à --help",
|
"arguments-missing-error": "Certains arguments nécessaires sont manquants, reportez-vous à --help",
|
||||||
|
|||||||
@ -138,7 +138,7 @@ it = {
|
|||||||
"hostname-empty-error": "Il campo hostname non può essere vuoto",
|
"hostname-empty-error": "Il campo hostname non può essere vuoto",
|
||||||
"empty-error": "Il campo {} non può esssere vuoto", # Configuration
|
"empty-error": "Il campo {} non può esssere vuoto", # Configuration
|
||||||
"media-player-error": "Errore media player: \"{}\"", # Error line
|
"media-player-error": "Errore media player: \"{}\"", # Error line
|
||||||
"unable-import-gui-error": "Non è possibile importare le librerie di interfaccia grafica. Hai bisogno di PySide per poter utilizzare l'interfaccia grafica.",
|
"unable-import-gui-error": "Non è possibile importare le librerie di interfaccia grafica. Hai bisogno di PySide per poter utilizzare l'interfaccia grafica. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work."
|
||||||
"unable-import-twisted-error": "Non è possibile importare Twisted. Si prega di installare Twisted v16.4.0 o superiore.",
|
"unable-import-twisted-error": "Non è possibile importare Twisted. Si prega di installare Twisted v16.4.0 o superiore.",
|
||||||
|
|
||||||
"arguments-missing-error": "Alcuni argomenti obbligatori non sono stati trovati. Fai riferimento a --help",
|
"arguments-missing-error": "Alcuni argomenti obbligatori non sono stati trovati. Fai riferimento a --help",
|
||||||
|
|||||||
@ -138,7 +138,7 @@ ko = {
|
|||||||
"hostname-empty-error": "호스트이름은 비워둘 수 없습니다",
|
"hostname-empty-error": "호스트이름은 비워둘 수 없습니다",
|
||||||
"empty-error": "{}은(는) 비워 둘 수 없습니다", # Configuration
|
"empty-error": "{}은(는) 비워 둘 수 없습니다", # Configuration
|
||||||
"media-player-error": "미디어 플레이어 오류: \"{}\"", # Error line
|
"media-player-error": "미디어 플레이어 오류: \"{}\"", # Error line
|
||||||
"unable-import-gui-error": "GUI 라이브러리를 가져올 수 없습니다. PySide가 설치되어 있지 않은 경우 GUI가 작동하려면 설치해야 합니다.",
|
"unable-import-gui-error": "GUI 라이브러리를 가져올 수 없습니다. PySide가 설치되어 있지 않은 경우 GUI가 작동하려면 설치해야 합니다. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work."
|
||||||
"unable-import-twisted-error": "Twisted를 가져올 수 없습니다. Twisted v16.4.0 이상을 설치하세요.",
|
"unable-import-twisted-error": "Twisted를 가져올 수 없습니다. Twisted v16.4.0 이상을 설치하세요.",
|
||||||
|
|
||||||
"arguments-missing-error": "일부 필요한 인수가 누락되었습니다. --help를 참조하세요.",
|
"arguments-missing-error": "일부 필요한 인수가 누락되었습니다. --help를 참조하세요.",
|
||||||
|
|||||||
@ -138,7 +138,7 @@ pt_BR = {
|
|||||||
"hostname-empty-error": "O endereço do servidor não pode estar vazio",
|
"hostname-empty-error": "O endereço do servidor não pode estar vazio",
|
||||||
"empty-error": "{} não pode estar vazio", # Configuration
|
"empty-error": "{} não pode estar vazio", # Configuration
|
||||||
"media-player-error": "Erro do reprodutor de mídia: \"{}\"", # Error line
|
"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-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. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work."
|
||||||
"unable-import-twisted-error": "Não foi possível importar o Twisted. Por favor, instale o Twisted v16.4.0 ou superior.",
|
"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",
|
"arguments-missing-error": "Alguns argumentos necessários estão faltando, por favor reveja --help",
|
||||||
|
|||||||
@ -138,7 +138,7 @@ pt_PT = {
|
|||||||
"hostname-empty-error": "O endereço do servidor não pode ser vazio",
|
"hostname-empty-error": "O endereço do servidor não pode ser vazio",
|
||||||
"empty-error": "{} não pode ser vazio", # Configuration
|
"empty-error": "{} não pode ser vazio", # Configuration
|
||||||
"media-player-error": "Erro do reprodutor de mídia: \"{}\"", # Error line
|
"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-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. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work."
|
||||||
"unable-import-twisted-error": "Não foi possível importar o Twisted. Por favor, instale o Twisted v16.4.0 ou superior.",
|
"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",
|
"arguments-missing-error": "Alguns argumentos necessários estão faltando, por favor reveja --help",
|
||||||
|
|||||||
@ -138,7 +138,7 @@ ru = {
|
|||||||
"hostname-empty-error": "Имя пользователя не может быть пустым.",
|
"hostname-empty-error": "Имя пользователя не может быть пустым.",
|
||||||
"empty-error": "{} не может быть пустым.", # Configuration
|
"empty-error": "{} не может быть пустым.", # Configuration
|
||||||
"media-player-error": "Ошибка проигрывателя: \"{}\"", # Error line
|
"media-player-error": "Ошибка проигрывателя: \"{}\"", # Error line
|
||||||
"unable-import-gui-error": "Невозможно импортировать библиотеки графического интерфейса. Необходимо установить PySide, иначе графический интерфейс не будет работать.",
|
"unable-import-gui-error": "Невозможно импортировать библиотеки графического интерфейса. Необходимо установить PySide, иначе графический интерфейс не будет работать. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work."
|
||||||
"unable-import-twisted-error": "Невозможно импортировать Twisted. Установите Twisted 16.4.0 или более позднюю версию.",
|
"unable-import-twisted-error": "Невозможно импортировать Twisted. Установите Twisted 16.4.0 или более позднюю версию.",
|
||||||
|
|
||||||
"arguments-missing-error": "Некоторые необходимые аргументы отсутствуют, обратитесь к --help",
|
"arguments-missing-error": "Некоторые необходимые аргументы отсутствуют, обратитесь к --help",
|
||||||
|
|||||||
@ -98,7 +98,7 @@ tr = {
|
|||||||
"commandlist-notification/undo": "\tu - son isteği geri alır",
|
"commandlist-notification/undo": "\tu - son isteği geri alır",
|
||||||
"commandlist-notification/pause": "\tp - duraklatmayı değiştirir",
|
"commandlist-notification/pause": "\tp - duraklatmayı değiştirir",
|
||||||
"commandlist-notification/seek": "\t[s][+-]time - verilen zaman değerine atlar, eğer + veya - belirtilmezse, saniye:dakika cinsinden mutlak zamandır.",
|
"commandlist-notification/seek": "\t[s][+-]time - verilen zaman değerine atlar, eğer + veya - belirtilmezse, saniye:dakika cinsinden mutlak zamandır.",
|
||||||
"commandlist-notification/offset": "\to[+-]duration - offset local playback by the given duration (in seconds or min:sec) from the server seek position - this is a deprecated feature", # TODO: Translate
|
"commandlist-notification/offset": "\to[+-]süre - yerel oynatmayı sunucu arama konumundan verilen süreye göre (saniye veya dakika:saniye cinsinden) dengeleme - bu, kullanımdan kaldırılmış bir özelliktir",
|
||||||
"commandlist-notification/help": "\th - yardım",
|
"commandlist-notification/help": "\th - yardım",
|
||||||
"commandlist-notification/toggle": "\tt - izlemeye hazır olup olmadığınızı değiştirir",
|
"commandlist-notification/toggle": "\tt - izlemeye hazır olup olmadığınızı değiştirir",
|
||||||
"commandlist-notification/setready": "\tsr [name] - sets user as ready", # TODO: Translate
|
"commandlist-notification/setready": "\tsr [name] - sets user as ready", # TODO: Translate
|
||||||
@ -107,10 +107,10 @@ tr = {
|
|||||||
"commandlist-notification/auth": "\ta [password] - operatör şifresi ile oda operatörü olarak kimlik doğrular",
|
"commandlist-notification/auth": "\ta [password] - operatör şifresi ile oda operatörü olarak kimlik doğrular",
|
||||||
"commandlist-notification/chat": "\tch [message] - bir odaya sohbet mesajı gönderir",
|
"commandlist-notification/chat": "\tch [message] - bir odaya sohbet mesajı gönderir",
|
||||||
"commandList-notification/queue": "\tqa [file/url] - oynatma listesinin altına dosya veya bağlantı ekler",
|
"commandList-notification/queue": "\tqa [file/url] - oynatma listesinin altına dosya veya bağlantı ekler",
|
||||||
"commandList-notification/queueandselect": "\tqas [file/url] - add file or url to bottom of playlist and select it", # TO DO: Translate
|
"commandList-notification/queueandselect": "\tqas [dosya/url] - oynatma listesinin en altına dosya veya URL ekler ve onu seçer",
|
||||||
"commandList-notification/playlist": "\tql - mevcut oynatma listesini gösterir",
|
"commandList-notification/playlist": "\tql - mevcut oynatma listesini gösterir",
|
||||||
"commandList-notification/select": "\tqs [index] - oynatma listesinde verilen girişi seçer",
|
"commandList-notification/select": "\tqs [index] - oynatma listesinde verilen girişi seçer",
|
||||||
"commandList-notification/next": "\tqn - select next entry in the playlist", # TODO: Translate
|
"commandList-notification/next": "\tqn - oynatma listesindeki sonraki girişi seçer",
|
||||||
"commandList-notification/delete": "\tqd [index] - verilen girişi oynatma listesinden siler",
|
"commandList-notification/delete": "\tqd [index] - verilen girişi oynatma listesinden siler",
|
||||||
"syncplay-version-notification": "Syncplay sürümü: {}", # syncplay.version
|
"syncplay-version-notification": "Syncplay sürümü: {}", # syncplay.version
|
||||||
"more-info-notification": "Daha fazla bilgiye şu adresten ulaşabilirsiniz: {}", # projectURL
|
"more-info-notification": "Daha fazla bilgiye şu adresten ulaşabilirsiniz: {}", # projectURL
|
||||||
@ -138,7 +138,7 @@ tr = {
|
|||||||
"hostname-empty-error": "Ana bilgisayar adı boş olamaz",
|
"hostname-empty-error": "Ana bilgisayar adı boş olamaz",
|
||||||
"empty-error": "{} boş olamaz", # Configuration
|
"empty-error": "{} boş olamaz", # Configuration
|
||||||
"media-player-error": "Medaya oynatıcısı hatası: \"{}\"", # Error line
|
"media-player-error": "Medaya oynatıcısı hatası: \"{}\"", # Error line
|
||||||
"unable-import-gui-error": "GUI kitaplıkları içe aktarılamadı. PySide kurulu değilse, GUI'nin çalışması için kurmanız gerekecektir.",
|
"unable-import-gui-error": "GUI kitaplıkları içe aktarılamadı. GUI'nin çalışması için PySide'ın doğru sürümünün kurulu olması gerekir. Syncplay'i terminal modunda çalıştırmak istiyorsanız --no-gui komut satırı anahtarıyla çalıştırın. Daha fazla ayrıntı için https://syncplay.pl/guide/ adresine bakın.",
|
||||||
"unable-import-twisted-error": "Twisted içe aktarılamadı. Lütfen Twisted v16.4.0 veya sonraki sürümünü yükleyin.",
|
"unable-import-twisted-error": "Twisted içe aktarılamadı. Lütfen Twisted v16.4.0 veya sonraki sürümünü yükleyin.",
|
||||||
|
|
||||||
"arguments-missing-error": "Bazı gerekli argümanlar eksik, bakınız --help",
|
"arguments-missing-error": "Bazı gerekli argümanlar eksik, bakınız --help",
|
||||||
@ -312,7 +312,7 @@ tr = {
|
|||||||
"autoplay-menu-label": "Otomatik oynat düğmesini göster",
|
"autoplay-menu-label": "Otomatik oynat düğmesini göster",
|
||||||
"autoplay-guipushbuttonlabel": "Her şey hazır olduğunda oynat",
|
"autoplay-guipushbuttonlabel": "Her şey hazır olduğunda oynat",
|
||||||
"autoplay-minimum-label": "Asgari kullanıcı:",
|
"autoplay-minimum-label": "Asgari kullanıcı:",
|
||||||
"hideemptyrooms-menu-label": "Hide empty persistent rooms", # TODO: Translate
|
"hideemptyrooms-menu-label": "Boş kalıcı odaları gizle",
|
||||||
|
|
||||||
"sendmessage-label": "Gönder",
|
"sendmessage-label": "Gönder",
|
||||||
|
|
||||||
@ -479,7 +479,7 @@ tr = {
|
|||||||
|
|
||||||
# Server messages to client
|
# Server messages to client
|
||||||
"new-syncplay-available-motd-message": "Syncplay {} kullanıyorsunuz ancak daha yeni bir sürüm https://syncplay.pl adresinde mevcut", # ClientVersion
|
"new-syncplay-available-motd-message": "Syncplay {} kullanıyorsunuz ancak daha yeni bir sürüm https://syncplay.pl adresinde mevcut", # ClientVersion
|
||||||
"persistent-rooms-notice": "NOTICE: This server uses persistent rooms, which means that the playlist information is stored between playback sessions. If you want to create a room where information is not saved then put -temp at the end of the room name.", # TO DO: Translate - NOTE: Do not translate the word -temp
|
"persistent-rooms-notice": "DİKKAT: Bu sunucu kalıcı odalar kullanır; bu, oynatma oturumları arasında oynatma listesi bilgilerinin saklandığı anlamına gelir. Bilgilerin kaydedilmediği bir oda oluşturmak istiyorsanız oda adının sonuna -temp koyun.",
|
||||||
"ready-chat-message": "I have set {} as ready.", # User # TODO: Translate
|
"ready-chat-message": "I have set {} as ready.", # User # TODO: Translate
|
||||||
"not-ready-chat-message": "I have set {} as not ready.", # User # TODO: Translate
|
"not-ready-chat-message": "I have set {} as not ready.", # User # TODO: Translate
|
||||||
|
|
||||||
@ -499,8 +499,8 @@ tr = {
|
|||||||
"server-salt-argument": "yönetilen oda şifreleri oluşturmak için kullanılan rastgele dize",
|
"server-salt-argument": "yönetilen oda şifreleri oluşturmak için kullanılan rastgele dize",
|
||||||
"server-disable-ready-argument": "hazır olma özelliğini devre dışı bırak",
|
"server-disable-ready-argument": "hazır olma özelliğini devre dışı bırak",
|
||||||
"server-motd-argument": "motd alınacak dosyanın yolu",
|
"server-motd-argument": "motd alınacak dosyanın yolu",
|
||||||
"server-rooms-argument": "path to database file to use and/or create to store persistent room data. Enables rooms to persist without watchers and through restarts", # TODO: Translate
|
"server-rooms-argument": "kalıcı oda verilerini depolamak için kullanılacak ve/veya oluşturulacak veritabanı dosyasının yolu. Odaların gözlemciler olmadan ve yeniden başlatmalar yoluyla varlığını sürdürmesini sağlar",
|
||||||
"server-permanent-rooms-argument": "path to file which lists permenant rooms that will be listed even if the room is empty (in the form of a text file which lists one room per line) - requires persistent rooms to be enabled", # TODO: Translate
|
"server-permanent-rooms-argument": "oda boş olsa bile listelenecek kalıcı odaları listeleyen dosyanın yolu (satır başına bir odayı listeleyen bir metin dosyası biçiminde) - kalıcı odaların etkinleştirilmesini gerektirir",
|
||||||
"server-chat-argument": "Sohbet devre dışı bırakılmalı mı?",
|
"server-chat-argument": "Sohbet devre dışı bırakılmalı mı?",
|
||||||
"server-chat-maxchars-argument": "Bir sohbet mesajındaki maksimum karakter sayısı (varsayılan: {})", # Default number of characters
|
"server-chat-maxchars-argument": "Bir sohbet mesajındaki maksimum karakter sayısı (varsayılan: {})", # Default number of characters
|
||||||
"server-maxusernamelength-argument": "Bir kullanıcı adındaki maksimum karakter sayısı (varsayılan {})",
|
"server-maxusernamelength-argument": "Bir kullanıcı adındaki maksimum karakter sayısı (varsayılan {})",
|
||||||
|
|||||||
@ -138,7 +138,7 @@ zh_CN = {
|
|||||||
"hostname-empty-error": "主机名不能是空的",
|
"hostname-empty-error": "主机名不能是空的",
|
||||||
"empty-error": "{}不能是空的", # Configuration
|
"empty-error": "{}不能是空的", # Configuration
|
||||||
"media-player-error": "媒体播放器错误:\"{}\"", # Error line
|
"media-player-error": "媒体播放器错误:\"{}\"", # Error line
|
||||||
"unable-import-gui-error": "无法导入GUI库。如果你没有安装PySide,GUI则无法工作,请安装PySide。",
|
"unable-import-gui-error": "无法导入GUI库。如果你没有安装PySide,GUI则无法工作,请安装PySide。 If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work."
|
||||||
"unable-import-twisted-error": "无法导入Twisted。请安装Twisted v16.4.0或更高版本。",
|
"unable-import-twisted-error": "无法导入Twisted。请安装Twisted v16.4.0或更高版本。",
|
||||||
|
|
||||||
"arguments-missing-error": "缺少一些必要的参数,使用--help命令查看详细信息",
|
"arguments-missing-error": "缺少一些必要的参数,使用--help命令查看详细信息",
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
# coding:utf8
|
# coding:utf8
|
||||||
import os
|
import os
|
||||||
|
import random
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
@ -10,8 +11,9 @@ import ast
|
|||||||
from syncplay import constants
|
from syncplay import constants
|
||||||
from syncplay.messages import getMessage
|
from syncplay.messages import getMessage
|
||||||
from syncplay.players.basePlayer import BasePlayer
|
from syncplay.players.basePlayer import BasePlayer
|
||||||
from syncplay.utils import isURL, findResourcePath
|
from syncplay.utils import getRuntimeDir, isURL, findResourcePath
|
||||||
from syncplay.utils import isMacOS, isWindows, isASCII
|
from syncplay.utils import isMacOS, isWindows, isASCII
|
||||||
|
from syncplay.utils import playerPathExists
|
||||||
from syncplay.vendor.python_mpv_jsonipc.python_mpv_jsonipc import MPV
|
from syncplay.vendor.python_mpv_jsonipc.python_mpv_jsonipc import MPV
|
||||||
|
|
||||||
class MpvPlayer(BasePlayer):
|
class MpvPlayer(BasePlayer):
|
||||||
@ -90,11 +92,11 @@ class MpvPlayer(BasePlayer):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getExpandedPath(playerPath):
|
def getExpandedPath(playerPath):
|
||||||
if not os.path.isfile(playerPath):
|
if not playerPathExists(playerPath):
|
||||||
if os.path.isfile(playerPath + "mpv.exe"):
|
if playerPathExists(playerPath + "mpv.exe"):
|
||||||
playerPath += "mpv.exe"
|
playerPath += "mpv.exe"
|
||||||
return playerPath
|
return playerPath
|
||||||
elif os.path.isfile(playerPath + "\\mpv.exe"):
|
elif playerPathExists(playerPath + "\\mpv.exe"):
|
||||||
playerPath += "\\mpv.exe"
|
playerPath += "\\mpv.exe"
|
||||||
return playerPath
|
return playerPath
|
||||||
if os.access(playerPath, os.X_OK):
|
if os.access(playerPath, os.X_OK):
|
||||||
@ -181,6 +183,9 @@ class MpvPlayer(BasePlayer):
|
|||||||
self._listener.sendLine(["print_text", '"ANS_{}=${{{}}}"'.format(property_, propertyID)])
|
self._listener.sendLine(["print_text", '"ANS_{}=${{{}}}"'.format(property_, propertyID)])
|
||||||
|
|
||||||
def getCalculatedPosition(self):
|
def getCalculatedPosition(self):
|
||||||
|
if self._recentlyReset():
|
||||||
|
return 0
|
||||||
|
|
||||||
if self.fileLoaded == False:
|
if self.fileLoaded == False:
|
||||||
self._client.ui.showDebugMessage(
|
self._client.ui.showDebugMessage(
|
||||||
"File not loaded so using GlobalPosition for getCalculatedPosition({})".format(
|
"File not loaded so using GlobalPosition for getCalculatedPosition({})".format(
|
||||||
@ -375,7 +380,7 @@ class MpvPlayer(BasePlayer):
|
|||||||
self._listener.sendLine(['loadfile', filePath], notReadyAfterThis=True)
|
self._listener.sendLine(['loadfile', filePath], notReadyAfterThis=True)
|
||||||
|
|
||||||
def setFeatures(self, featureList):
|
def setFeatures(self, featureList):
|
||||||
self.sendMpvOptions()
|
self._sendMpvOptions()
|
||||||
|
|
||||||
def setPosition(self, value):
|
def setPosition(self, value):
|
||||||
if value < constants.DO_NOT_RESET_POSITION_THRESHOLD and self._recentlyReset():
|
if value < constants.DO_NOT_RESET_POSITION_THRESHOLD and self._recentlyReset():
|
||||||
@ -408,7 +413,7 @@ class MpvPlayer(BasePlayer):
|
|||||||
self._storePosition(0)
|
self._storePosition(0)
|
||||||
# TO TRY: self._listener.setReadyToSend(False)
|
# TO TRY: self._listener.setReadyToSend(False)
|
||||||
|
|
||||||
def sendMpvOptions(self):
|
def _sendMpvOptions(self):
|
||||||
options = []
|
options = []
|
||||||
for option in constants.MPV_SYNCPLAYINTF_OPTIONS_TO_SEND:
|
for option in constants.MPV_SYNCPLAYINTF_OPTIONS_TO_SEND:
|
||||||
options.append("{}={}".format(option, self._client._config[option]))
|
options.append("{}={}".format(option, self._client._config[option]))
|
||||||
@ -420,6 +425,9 @@ class MpvPlayer(BasePlayer):
|
|||||||
options_string = ", ".join(options)
|
options_string = ", ".join(options)
|
||||||
self._listener.sendLine(["script-message-to", "syncplayintf", "set_syncplayintf_options", options_string])
|
self._listener.sendLine(["script-message-to", "syncplayintf", "set_syncplayintf_options", options_string])
|
||||||
self._setOSDPosition()
|
self._setOSDPosition()
|
||||||
|
socketPath = self._listener.mpv_arguments.get("input-ipc-server")
|
||||||
|
if socketPath is not None:
|
||||||
|
self._setProperty("input-ipc-server", socketPath)
|
||||||
|
|
||||||
def _handleUnknownLine(self, line):
|
def _handleUnknownLine(self, line):
|
||||||
self.mpvErrorCheck(line)
|
self.mpvErrorCheck(line)
|
||||||
@ -447,7 +455,7 @@ class MpvPlayer(BasePlayer):
|
|||||||
#self._client.ui.showDebugMessage("{} = {} / {}".format(update_string, paused_update, position_update))
|
#self._client.ui.showDebugMessage("{} = {} / {}".format(update_string, paused_update, position_update))
|
||||||
|
|
||||||
if "<get_syncplayintf_options>" in line:
|
if "<get_syncplayintf_options>" in line:
|
||||||
self.sendMpvOptions()
|
self._sendMpvOptions()
|
||||||
|
|
||||||
if line == "<SyncplayUpdateFile>" or "Playing:" in line:
|
if line == "<SyncplayUpdateFile>" or "Playing:" in line:
|
||||||
self._client.ui.showDebugMessage("Not ready to send due to <SyncplayUpdateFile>")
|
self._client.ui.showDebugMessage("Not ready to send due to <SyncplayUpdateFile>")
|
||||||
@ -618,8 +626,15 @@ class MpvPlayer(BasePlayer):
|
|||||||
env['PATH'] = python_executable + ':' + env['PATH']
|
env['PATH'] = python_executable + ':' + env['PATH']
|
||||||
env['PYTHONPATH'] = pythonPath
|
env['PYTHONPATH'] = pythonPath
|
||||||
try:
|
try:
|
||||||
socket = self.mpv_arguments.get('input-ipc-server')
|
self.mpvpipe = self.playerIPCHandler(
|
||||||
self.mpvpipe = self.playerIPCHandler(mpv_location=self.playerPath, ipc_socket=socket, loglevel="info", log_handler=self.__playerController.mpv_log_handler, quit_callback=self.stop_client, env=env, **self.mpv_arguments)
|
loglevel="info",
|
||||||
|
ipc_socket=self._get_ipc_socket(),
|
||||||
|
mpv_location=self.playerPath,
|
||||||
|
log_handler=self.__playerController.mpv_log_handler,
|
||||||
|
quit_callback=self.stop_client,
|
||||||
|
env=env,
|
||||||
|
**self.mpv_arguments
|
||||||
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.quitReason = getMessage("media-player-error").format(str(e)) + " " + getMessage("mpv-failed-advice")
|
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.reactor.callFromThread(self.__playerController._client.ui.showErrorMessage, self.quitReason, True)
|
||||||
@ -628,6 +643,12 @@ class MpvPlayer(BasePlayer):
|
|||||||
#self.mpvpipe.show_text("HELLO WORLD!", 1000)
|
#self.mpvpipe.show_text("HELLO WORLD!", 1000)
|
||||||
threading.Thread.__init__(self, name="MPV Listener")
|
threading.Thread.__init__(self, name="MPV Listener")
|
||||||
|
|
||||||
|
def _get_ipc_socket(self):
|
||||||
|
if isWindows():
|
||||||
|
# On Windows, mpv expects a named pipe identifier (not a path)
|
||||||
|
return "syncplay-mpv-{0}".format(random.randint(0, 2**48))
|
||||||
|
return getRuntimeDir().joinpath("mpv-socket").as_posix()
|
||||||
|
|
||||||
def __getCwd(self, filePath, env):
|
def __getCwd(self, filePath, env):
|
||||||
if not filePath:
|
if not filePath:
|
||||||
return None
|
return None
|
||||||
|
|||||||
@ -50,9 +50,4 @@ class MpvnetPlayer(MpvPlayer):
|
|||||||
def getIconPath(path):
|
def getIconPath(path):
|
||||||
return constants.MPVNET_ICONPATH
|
return constants.MPVNET_ICONPATH
|
||||||
|
|
||||||
def sendMpvOptions(self):
|
|
||||||
for key in self._listener.mpv_arguments:
|
|
||||||
if key != "script" and key != "input-ipc-server":
|
|
||||||
self._setProperty(key, self._listener.mpv_arguments[key])
|
|
||||||
super().sendMpvOptions()
|
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,9 @@ class ConfigurationGetter(object):
|
|||||||
"slowOnDesync": True,
|
"slowOnDesync": True,
|
||||||
"fastforwardOnDesync": True,
|
"fastforwardOnDesync": True,
|
||||||
"dontSlowDownWithMe": False,
|
"dontSlowDownWithMe": False,
|
||||||
|
"folderSearchFirstFileTimeout": constants.FOLDER_SEARCH_FIRST_FILE_TIMEOUT,
|
||||||
|
"folderSearchTimeout": constants.FOLDER_SEARCH_TIMEOUT,
|
||||||
|
"folderSearchDoubleCheckInterval": constants.FOLDER_SEARCH_DOUBLE_CHECK_INTERVAL,
|
||||||
"filenamePrivacyMode": constants.PRIVACY_SENDRAW_MODE,
|
"filenamePrivacyMode": constants.PRIVACY_SENDRAW_MODE,
|
||||||
"filesizePrivacyMode": constants.PRIVACY_SENDRAW_MODE,
|
"filesizePrivacyMode": constants.PRIVACY_SENDRAW_MODE,
|
||||||
"pauseOnLeave": False,
|
"pauseOnLeave": False,
|
||||||
@ -163,6 +166,9 @@ class ConfigurationGetter(object):
|
|||||||
"slowdownThreshold",
|
"slowdownThreshold",
|
||||||
"rewindThreshold",
|
"rewindThreshold",
|
||||||
"fastforwardThreshold",
|
"fastforwardThreshold",
|
||||||
|
"folderSearchFirstFileTimeout",
|
||||||
|
"folderSearchTimeout",
|
||||||
|
"folderSearchDoubleCheckInterval",
|
||||||
"autoplayMinUsers",
|
"autoplayMinUsers",
|
||||||
"chatInputRelativeFontSize",
|
"chatInputRelativeFontSize",
|
||||||
"chatInputFontWeight",
|
"chatInputFontWeight",
|
||||||
@ -188,6 +194,7 @@ class ConfigurationGetter(object):
|
|||||||
"name", "room", "roomList", "playerPath",
|
"name", "room", "roomList", "playerPath",
|
||||||
"perPlayerArguments", "slowdownThreshold",
|
"perPlayerArguments", "slowdownThreshold",
|
||||||
"rewindThreshold", "fastforwardThreshold",
|
"rewindThreshold", "fastforwardThreshold",
|
||||||
|
"folderSearchFirstFileTimeout", "folderSearchTimeout", "folderSearchDoubleCheckInterval",
|
||||||
"slowOnDesync", "rewindOnDesync",
|
"slowOnDesync", "rewindOnDesync",
|
||||||
"fastforwardOnDesync", "dontSlowDownWithMe",
|
"fastforwardOnDesync", "dontSlowDownWithMe",
|
||||||
"forceGuiPrompt", "filenamePrivacyMode",
|
"forceGuiPrompt", "filenamePrivacyMode",
|
||||||
@ -520,7 +527,7 @@ class ConfigurationGetter(object):
|
|||||||
from syncplay.vendor.Qt.QtCore import QCoreApplication
|
from syncplay.vendor.Qt.QtCore import QCoreApplication
|
||||||
from syncplay.vendor import qt5reactor
|
from syncplay.vendor import qt5reactor
|
||||||
if not (IsPySide6 or IsPySide2 or IsPySide):
|
if not (IsPySide6 or IsPySide2 or IsPySide):
|
||||||
raise ImportError
|
raise ImportError("Failed to identify compatible version of PySide.")
|
||||||
if QCoreApplication.instance() is None:
|
if QCoreApplication.instance() is None:
|
||||||
self.app = QtWidgets.QApplication(sys.argv)
|
self.app = QtWidgets.QApplication(sys.argv)
|
||||||
self.app.setDesktopFileName("syncplay")
|
self.app.setDesktopFileName("syncplay")
|
||||||
@ -537,13 +544,14 @@ class ConfigurationGetter(object):
|
|||||||
if isMacOS():
|
if isMacOS():
|
||||||
import appnope
|
import appnope
|
||||||
appnope.nope()
|
appnope.nope()
|
||||||
except ImportError:
|
except ImportError as e:
|
||||||
try:
|
try:
|
||||||
from twisted.trial import unittest
|
from twisted.trial import unittest
|
||||||
except Exception as e:
|
except Exception as ee:
|
||||||
print(e)
|
print(ee)
|
||||||
print(getMessage("unable-import-twisted-error"))
|
print(getMessage("unable-import-twisted-error"))
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
print(e)
|
||||||
print(getMessage("unable-import-gui-error"))
|
print(getMessage("unable-import-gui-error"))
|
||||||
self._config['noGui'] = True
|
self._config['noGui'] = True
|
||||||
if self._config['file'] and self._config['file'][:2] == "--":
|
if self._config['file'] and self._config['file'][:2] == "--":
|
||||||
|
|||||||
@ -1516,6 +1516,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
if isMacOS(): window.userlistLayout.setContentsMargins(3, 0, 3, 0)
|
if isMacOS(): window.userlistLayout.setContentsMargins(3, 0, 3, 0)
|
||||||
|
|
||||||
window.listSplit = QtWidgets.QSplitter(Qt.Vertical, self)
|
window.listSplit = QtWidgets.QSplitter(Qt.Vertical, self)
|
||||||
|
window.listSplit.setHandleWidth(6)
|
||||||
|
window.listSplit.setStyle(QtWidgets.QStyleFactory.create("fusion"))
|
||||||
window.listSplit.addWidget(window.userlistFrame)
|
window.listSplit.addWidget(window.userlistFrame)
|
||||||
window.listLayout.addWidget(window.listSplit)
|
window.listLayout.addWidget(window.listSplit)
|
||||||
window.roomsCombobox = QtWidgets.QComboBox(self)
|
window.roomsCombobox = QtWidgets.QComboBox(self)
|
||||||
@ -1550,8 +1552,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
window.topSplit.addWidget(window.outputFrame)
|
window.topSplit.addWidget(window.outputFrame)
|
||||||
window.topSplit.addWidget(window.listFrame)
|
window.topSplit.addWidget(window.listFrame)
|
||||||
|
window.topSplit.setHandleWidth(6)
|
||||||
window.topSplit.setStretchFactor(0, 4)
|
window.topSplit.setStretchFactor(0, 4)
|
||||||
window.topSplit.setStretchFactor(1, 5)
|
window.topSplit.setStretchFactor(1, 5)
|
||||||
|
window.topSplit.setStyle(QtWidgets.QStyleFactory.create("fusion"))
|
||||||
window.mainLayout.addWidget(window.topSplit)
|
window.mainLayout.addWidget(window.topSplit)
|
||||||
window.topSplit.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
window.topSplit.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import ast
|
import ast
|
||||||
|
import atexit
|
||||||
import datetime
|
import datetime
|
||||||
import hashlib
|
import hashlib
|
||||||
import itertools
|
import itertools
|
||||||
@ -10,11 +10,13 @@ import re
|
|||||||
import string
|
import string
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import tempfile
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
import urllib.error
|
import urllib.error
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from syncplay import constants
|
from syncplay import constants
|
||||||
from syncplay.messages import getMessage
|
from syncplay.messages import getMessage
|
||||||
@ -37,9 +39,28 @@ def isMacOS():
|
|||||||
def isBSD():
|
def isBSD():
|
||||||
return constants.OS_BSD in sys.platform or sys.platform.startswith(constants.OS_DRAGONFLY)
|
return constants.OS_BSD in sys.platform or sys.platform.startswith(constants.OS_DRAGONFLY)
|
||||||
|
|
||||||
|
|
||||||
def isWindowsConsole():
|
def isWindowsConsole():
|
||||||
return os.path.basename(sys.executable) == "SyncplayConsole.exe"
|
return os.path.basename(sys.executable) == "SyncplayConsole.exe"
|
||||||
|
|
||||||
|
|
||||||
|
def getRuntimeDir():
|
||||||
|
cachedPath = getattr(getRuntimeDir, "cachedPath", None)
|
||||||
|
if cachedPath is not None:
|
||||||
|
return cachedPath
|
||||||
|
|
||||||
|
baseDir = None
|
||||||
|
if not isWindows() and not isMacOS():
|
||||||
|
baseDir = os.getenv("XDG_RUNTIME_DIR", None)
|
||||||
|
|
||||||
|
tmp = tempfile.TemporaryDirectory(prefix="syncplay-", dir=baseDir)
|
||||||
|
atexit.register(tmp.cleanup)
|
||||||
|
|
||||||
|
o = Path(tmp.name)
|
||||||
|
setattr(getRuntimeDir, "cachedPath", o)
|
||||||
|
return o
|
||||||
|
|
||||||
|
|
||||||
def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None):
|
def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None):
|
||||||
"""Retry calling the decorated function using an exponential backoff.
|
"""Retry calling the decorated function using an exponential backoff.
|
||||||
|
|
||||||
@ -211,7 +232,8 @@ def blackholeStdoutForFrozenWindow():
|
|||||||
self._file = open(path, 'a', encoding='utf-8')
|
self._file = open(path, 'a', encoding='utf-8')
|
||||||
# TODO: Handle errors.
|
# TODO: Handle errors.
|
||||||
if self._file is not None:
|
if self._file is not None:
|
||||||
self._file.write(text)
|
if not (text.startswith("<frozen zipimport>") and "UserWarning:" in text):
|
||||||
|
self._file.write(text)
|
||||||
self._file.flush()
|
self._file.flush()
|
||||||
|
|
||||||
def flush(self):
|
def flush(self):
|
||||||
@ -305,7 +327,7 @@ def stripfilename(filename, stripURL):
|
|||||||
def stripRoomName(RoomName):
|
def stripRoomName(RoomName):
|
||||||
if RoomName:
|
if RoomName:
|
||||||
try:
|
try:
|
||||||
return re.sub(constants.ROOM_NAME_STRIP_REGEX, "\g<roomnamebase>", RoomName)
|
return re.sub(constants.ROOM_NAME_STRIP_REGEX, r"\g<roomnamebase>", RoomName)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
return RoomName
|
return RoomName
|
||||||
else:
|
else:
|
||||||
@ -483,8 +505,8 @@ def getListOfPublicServers():
|
|||||||
|
|
||||||
|
|
||||||
class RoomPasswordProvider(object):
|
class RoomPasswordProvider(object):
|
||||||
CONTROLLED_ROOM_REGEX = re.compile("^\+(.*):(\w{12})$")
|
CONTROLLED_ROOM_REGEX = re.compile(r"^\+(.*):(\w{12})$")
|
||||||
PASSWORD_REGEX = re.compile("[A-Z]{2}-\d{3}-\d{3}")
|
PASSWORD_REGEX = re.compile(r"[A-Z]{2}-\d{3}-\d{3}")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def isControlledRoom(roomName):
|
def isControlledRoom(roomName):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user