mirror of
https://gitlab.com/RemixDev/deemix-gui-pyweb.git
synced 2025-01-16 03:25:15 +00:00
Added support for family accounts in the backend
This commit is contained in:
parent
df4f93fb94
commit
fed6909167
|
@ -1,4 +1,4 @@
|
||||||
deemix
|
deemix==1.0.6
|
||||||
flask
|
flask
|
||||||
flask-socketio
|
flask-socketio
|
||||||
pywebview
|
pywebview
|
||||||
|
|
12
server.py
12
server.py
|
@ -104,26 +104,32 @@ def on_connect():
|
||||||
|
|
||||||
|
|
||||||
@socketio.on('login')
|
@socketio.on('login')
|
||||||
def login(arl, force=False):
|
def login(arl, force=False, child=0):
|
||||||
global firstConnection
|
global firstConnection
|
||||||
emit('toast', {'msg': "Logging in...", 'icon': 'loading', 'dismiss': False, 'id': "login-toast"})
|
emit('toast', {'msg': "Logging in...", 'icon': 'loading', 'dismiss': False, 'id': "login-toast"})
|
||||||
if not session['dz'].logged_in:
|
if not session['dz'].logged_in:
|
||||||
result = session['dz'].login_via_arl(arl)
|
result = session['dz'].login_via_arl(arl, child)
|
||||||
else:
|
else:
|
||||||
if force:
|
if force:
|
||||||
session['dz'] = Deezer()
|
session['dz'] = Deezer()
|
||||||
result = session['dz'].login_via_arl(arl)
|
result = session['dz'].login_via_arl(arl, child)
|
||||||
if result == 1:
|
if result == 1:
|
||||||
result = 3
|
result = 3
|
||||||
else:
|
else:
|
||||||
result = 2
|
result = 2
|
||||||
emit('logged_in', {'status': result, 'arl': arl, 'user': session['dz'].user})
|
emit('logged_in', {'status': result, 'arl': arl, 'user': session['dz'].user})
|
||||||
|
emit('familyAccounts', session['dz'].childs)
|
||||||
emit('init_favorites', app.getUserFavorites(session['dz']))
|
emit('init_favorites', app.getUserFavorites(session['dz']))
|
||||||
if firstConnection and result in [1, 3]:
|
if firstConnection and result in [1, 3]:
|
||||||
firstConnection = False
|
firstConnection = False
|
||||||
app.loadDownloadQueue(session['dz'], socket_interface)
|
app.loadDownloadQueue(session['dz'], socket_interface)
|
||||||
|
|
||||||
|
|
||||||
|
@socketio.on('changeAccount')
|
||||||
|
def changeAccount(child):
|
||||||
|
emit('accountChanged', session['dz'].change_account(child))
|
||||||
|
emit('init_favorites', app.getUserFavorites(session['dz']))
|
||||||
|
|
||||||
|
|
||||||
@socketio.on('logout')
|
@socketio.on('logout')
|
||||||
def logout():
|
def logout():
|
||||||
|
|
2
webui
2
webui
|
@ -1 +1 @@
|
||||||
Subproject commit 7695632a6701c1d860af3d2447ea13e9e515d18b
|
Subproject commit 379ab344ef3012429b82fc1fd4d50ad7f90cfaa7
|
Loading…
Reference in a new issue