mirror of
https://gitlab.com/RemixDev/deemix-gui-pyweb.git
synced 2024-12-29 10:56:06 +00:00
Add new albumSearch and newReleases endpoints
This commit is contained in:
parent
f231825446
commit
d132c0ba54
6
app.py
6
app.py
|
@ -137,6 +137,12 @@ class deemix:
|
||||||
def search(self, dz, term, type, start, nb):
|
def search(self, dz, term, type, start, nb):
|
||||||
return dz.search(term, type, nb, start)
|
return dz.search(term, type, nb, start)
|
||||||
|
|
||||||
|
def searchAlbum(self, dz, term, start, nb):
|
||||||
|
return dz.search_album_gw(term, start, nb)
|
||||||
|
|
||||||
|
def newReleases(self, dz):
|
||||||
|
return dz.get_new_releases()
|
||||||
|
|
||||||
# Queue functions
|
# Queue functions
|
||||||
def addToQueue(self, dz, url, bitrate=None, interface=None, ack=None):
|
def addToQueue(self, dz, url, bitrate=None, interface=None, ack=None):
|
||||||
if ';' in url:
|
if ';' in url:
|
||||||
|
|
20
server.py
20
server.py
|
@ -266,6 +266,26 @@ def search(data):
|
||||||
result['ack'] = data.get('ack')
|
result['ack'] = data.get('ack')
|
||||||
emit('search', result)
|
emit('search', result)
|
||||||
|
|
||||||
|
@socketio.on('albumSearch')
|
||||||
|
def albumSearch(data):
|
||||||
|
if data['term'].strip() != "":
|
||||||
|
albums = app.searchAlbum(session['dz'], data['term'], data['start'], data['nb'])
|
||||||
|
output = {
|
||||||
|
'data': albums,
|
||||||
|
'total': len(albums),
|
||||||
|
'ack': data.get('ack')
|
||||||
|
};
|
||||||
|
emit('albumSearch', output)
|
||||||
|
|
||||||
|
@socketio.on('newReleases')
|
||||||
|
def newReleases(data):
|
||||||
|
result = app.newReleases(session['dz'])
|
||||||
|
output = {
|
||||||
|
'data': result,
|
||||||
|
'total': len(result),
|
||||||
|
'ack': data.get('ack')
|
||||||
|
};
|
||||||
|
emit('newReleases', output)
|
||||||
|
|
||||||
@socketio.on('queueRestored')
|
@socketio.on('queueRestored')
|
||||||
def queueRestored():
|
def queueRestored():
|
||||||
|
|
Loading…
Reference in a new issue