From e0ebffac8c45e4e3d7066c103ff8f4da47453f69 Mon Sep 17 00:00:00 2001 From: kermit Date: Mon, 14 Sep 2020 15:58:33 +0100 Subject: [PATCH 1/2] Pass ack back on add to queue --- app.py | 4 ++-- server.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 7008837..db08fd7 100644 --- a/app.py +++ b/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): diff --git a/server.py b/server.py index 4fb70ce..35e24eb 100644 --- a/server.py +++ b/server.py @@ -251,7 +251,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') From 4fb218be56f73737bdeb7229147360b1b3d289c6 Mon Sep 17 00:00:00 2001 From: kermit Date: Mon, 14 Sep 2020 16:32:18 +0100 Subject: [PATCH 2/2] Pass ack back on search --- server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 35e24eb..bd55766 100644 --- a/server.py +++ b/server.py @@ -233,7 +233,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') @@ -241,6 +243,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)