Added support for family accounts in the backend

This commit is contained in:
RemixDev 2020-05-30 19:32:05 +02:00
parent df4f93fb94
commit fed6909167
3 changed files with 11 additions and 5 deletions

View file

@ -1,4 +1,4 @@
deemix
deemix==1.0.6
flask
flask-socketio
pywebview

View file

@ -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

@ -1 +1 @@
Subproject commit 7695632a6701c1d860af3d2447ea13e9e515d18b
Subproject commit 379ab344ef3012429b82fc1fd4d50ad7f90cfaa7