add files to playlist from chat
This commit is contained in:
parent
d4ac455624
commit
0bd0a66a4f
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user