mirror of
https://gitlab.com/RemixDev/deemix-gui-pyweb.git
synced 2024-12-28 02:16:16 +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-socketio
|
||||
pywebview
|
||||
|
|
12
server.py
12
server.py
|
@ -104,26 +104,32 @@ def on_connect():
|
|||
|
||||
|
||||
@socketio.on('login')
|
||||
def login(arl, force=False):
|
||||
def login(arl, force=False, child=0):
|
||||
global firstConnection
|
||||
emit('toast', {'msg': "Logging in...", 'icon': 'loading', 'dismiss': False, 'id': "login-toast"})
|
||||
if not session['dz'].logged_in:
|
||||
result = session['dz'].login_via_arl(arl)
|
||||
result = session['dz'].login_via_arl(arl, child)
|
||||
else:
|
||||
if force:
|
||||
session['dz'] = Deezer()
|
||||
result = session['dz'].login_via_arl(arl)
|
||||
result = session['dz'].login_via_arl(arl, child)
|
||||
if result == 1:
|
||||
result = 3
|
||||
else:
|
||||
result = 2
|
||||
emit('logged_in', {'status': result, 'arl': arl, 'user': session['dz'].user})
|
||||
emit('familyAccounts', session['dz'].childs)
|
||||
emit('init_favorites', app.getUserFavorites(session['dz']))
|
||||
if firstConnection and result in [1, 3]:
|
||||
firstConnection = False
|
||||
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')
|
||||
def logout():
|
||||
|
|
2
webui
2
webui
|
@ -1 +1 @@
|
|||
Subproject commit 7695632a6701c1d860af3d2447ea13e9e515d18b
|
||||
Subproject commit 379ab344ef3012429b82fc1fd4d50ad7f90cfaa7
|
Loading…
Reference in a new issue