diff --git a/syncplay/constants.py b/syncplay/constants.py index 7e5d355..e157406 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -124,6 +124,7 @@ COMMANDS_HELP = ['help', 'h', '?', '/?', r'\?'] COMMANDS_CREATE = ['c', 'create'] COMMANDS_AUTH = ['a', 'auth'] COMMANDS_TOGGLE = ['t', 'toggle'] +COMMANDS_QUEUE = ['queue', 'q', 'add'] 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_de.py b/syncplay/messages_de.py index 13331a0..2f4eed3 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -87,6 +87,7 @@ 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": "\tq [file/URL] - add file or URL to bottom of playlist", # TODO: Translate "syncplay-version-notification": "Syncplay Version: {}", # syncplay.version "more-info-notification": "Weitere Informationen auf: {}", # projectURL diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 9576967..3ff66f1 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -87,6 +87,7 @@ 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": "\tq [file/URL] - add file or URL to bottom of playlist", "syncplay-version-notification": "Syncplay version: {}", # syncplay.version "more-info-notification": "More info available at: {}", # projectURL diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index 4cfca73..84a015b 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -87,6 +87,7 @@ 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": "\tq [file/URL] - add file or URL to bottom of playlist", # TODO: 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 4e0d98c..756330f 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -87,6 +87,7 @@ 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": "\tq [file/URL] - add file or URL to bottom of playlist", # TODO: 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 a277714..a63471f 100644 --- a/syncplay/messages_pt_BR.py +++ b/syncplay/messages_pt_BR.py @@ -87,6 +87,7 @@ 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": "\tq [file/URL] - add file or URL to bottom of playlist", # TODO: 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 aa314af..92727e1 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -87,6 +87,7 @@ 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": "\tq [file/URL] - add file or URL to bottom of playlist", # TODO: Translate "syncplay-version-notification": "Версия Syncplay: {}", # syncplay.version "more-info-notification": "Больше информации на {}", # projectURL diff --git a/syncplay/ui/consoleUI.py b/syncplay/ui/consoleUI.py index a7d2a4c..b32a042 100755 --- a/syncplay/ui/consoleUI.py +++ b/syncplay/ui/consoleUI.py @@ -184,6 +184,9 @@ 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') + self._syncplayClient.ui.addFileToPlaylist(filename) else: if self._tryAdvancedCommands(data): return @@ -200,6 +203,7 @@ 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("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 5dfec61..9631ef9 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -1881,7 +1881,7 @@ class MainWindow(QtWidgets.QMainWindow): self.playlist.setPlaylistIndexFilename(filename) def addFileToPlaylist(self, filePath, index=-1): - if os.path.isfile(filePath): + if not isURL(filePath): self.removePlaylistNote() filename = os.path.basename(filePath) if self.noPlaylistDuplicates(filename): @@ -1890,7 +1890,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: