mirror of
https://gitlab.com/RemixDev/deemix-gui-pyweb.git
synced 2024-12-28 02:16:16 +00:00
Merge pull request 'Return user specified ack on search and addToQueue requests' (#24) from kermit/deemix-pyweb:ack into main
Reviewed-on: https://codeberg.org/RemixDev/deemix-pyweb/pulls/24
This commit is contained in:
commit
053b7fdfac
4
app.py
4
app.py
|
@ -137,10 +137,10 @@ class deemix:
|
|||
return dz.search(term, type, nb, start)
|
||||
|
||||
# Queue functions
|
||||
def addToQueue(self, dz, url, bitrate=None, interface=None):
|
||||
def addToQueue(self, dz, url, bitrate=None, interface=None, ack=None):
|
||||
if ';' in url:
|
||||
url = url.split(";")
|
||||
self.qm.addToQueue(dz, url, self.set.settings, bitrate, interface)
|
||||
self.qm.addToQueue(dz, url, self.set.settings, bitrate, interface, ack)
|
||||
|
||||
|
||||
def removeFromQueue(self, uuid, interface=None):
|
||||
|
|
|
@ -234,7 +234,9 @@ def logout():
|
|||
@socketio.on('mainSearch')
|
||||
def mainSearch(data):
|
||||
if data['term'].strip() != "":
|
||||
emit('mainSearch', app.mainSearch(session['dz'], data['term']))
|
||||
result = app.mainSearch(session['dz'], data['term'])
|
||||
result['ack'] = data.get('ack')
|
||||
emit('mainSearch', result)
|
||||
|
||||
|
||||
@socketio.on('search')
|
||||
|
@ -242,6 +244,7 @@ def search(data):
|
|||
if data['term'].strip() != "":
|
||||
result = app.search(session['dz'], data['term'], data['type'], data['start'], data['nb'])
|
||||
result['type'] = data['type']
|
||||
result['ack'] = data.get('ack')
|
||||
emit('search', result)
|
||||
|
||||
|
||||
|
@ -252,7 +255,7 @@ def queueRestored():
|
|||
|
||||
@socketio.on('addToQueue')
|
||||
def addToQueue(data):
|
||||
result = app.addToQueue(session['dz'], data['url'], data['bitrate'], interface=socket_interface)
|
||||
result = app.addToQueue(session['dz'], data['url'], data['bitrate'], interface=socket_interface, ack=data.get('ack'))
|
||||
if result == "Not logged in":
|
||||
emit('loginNeededToDownload')
|
||||
|
||||
|
|
Loading…
Reference in a new issue