mirror of
https://gitlab.com/RemixDev/deemix-gui-pyweb.git
synced 2024-12-29 10:56:06 +00:00
Added clear and cancel queue buttons
This commit is contained in:
parent
a65e157bd0
commit
98a3935ced
8
app.py
8
app.py
|
@ -1,5 +1,5 @@
|
||||||
import deemix.utils.localpaths as localpaths
|
import deemix.utils.localpaths as localpaths
|
||||||
from deemix.app.queuemanager import addToQueue, removeFromQueue, getQueue, cancelAllDownloads
|
from deemix.app.queuemanager import addToQueue, removeFromQueue, getQueue, cancelAllDownloads, removeFinishedDownloads
|
||||||
from deemix.app.settings import initSettings, getSettings, saveSettings
|
from deemix.app.settings import initSettings, getSettings, saveSettings
|
||||||
from os import system as execute
|
from os import system as execute
|
||||||
|
|
||||||
|
@ -30,6 +30,12 @@ def addToQueue_link(dz, url, bitrate=None, socket=None):
|
||||||
def removeFromQueue_link(uuid, socket=None):
|
def removeFromQueue_link(uuid, socket=None):
|
||||||
removeFromQueue(uuid, socket)
|
removeFromQueue(uuid, socket)
|
||||||
|
|
||||||
|
def cancelAllDownloads_link(socket=None):
|
||||||
|
cancelAllDownloads(socket)
|
||||||
|
|
||||||
|
def removeFinishedDownloads_link(socket=None):
|
||||||
|
removeFinishedDownloads(socket)
|
||||||
|
|
||||||
def getSettings_link():
|
def getSettings_link():
|
||||||
return getSettings()
|
return getSettings()
|
||||||
|
|
||||||
|
|
12
server.py
12
server.py
|
@ -50,8 +50,8 @@ def closing():
|
||||||
def on_connect():
|
def on_connect():
|
||||||
session['dz'] = Deezer()
|
session['dz'] = Deezer()
|
||||||
emit('init_settings', app.getSettings_link())
|
emit('init_settings', app.getSettings_link())
|
||||||
queue, queueList, currentItem = app.getQueue_link()
|
queue, queueComplete, queueList, currentItem = app.getQueue_link()
|
||||||
emit('init_downloadQueue', {'queue': queue, 'queueList': queueList, 'currentItem': currentItem})
|
emit('init_downloadQueue', {'queue': queue, 'queueComplete': queueComplete, 'queueList': queueList, 'currentItem': currentItem})
|
||||||
|
|
||||||
@socketio.on('login')
|
@socketio.on('login')
|
||||||
def login(arl, force=False):
|
def login(arl, force=False):
|
||||||
|
@ -118,6 +118,14 @@ def addToQueue(data):
|
||||||
def removeFromQueue(uuid):
|
def removeFromQueue(uuid):
|
||||||
app.removeFromQueue_link(uuid, socket=socketio)
|
app.removeFromQueue_link(uuid, socket=socketio)
|
||||||
|
|
||||||
|
@socketio.on('removeFinishedDownloads')
|
||||||
|
def removeFinishedDownloads():
|
||||||
|
app.removeFinishedDownloads_link(socket=socketio)
|
||||||
|
|
||||||
|
@socketio.on('cancelAllDownloads')
|
||||||
|
def cancelAllDownloads():
|
||||||
|
app.cancelAllDownloads_link(socket=socketio)
|
||||||
|
|
||||||
# Example code leftover, could be usefull later on
|
# Example code leftover, could be usefull later on
|
||||||
@server.route('/choose/path', methods=['POST'])
|
@server.route('/choose/path', methods=['POST'])
|
||||||
def choose_path():
|
def choose_path():
|
||||||
|
|
Loading…
Reference in a new issue