Implemented reset settings and added missing options

Tags selection not added yet
This commit is contained in:
RemixDev 2020-05-03 16:21:37 +02:00
parent 30ceca014a
commit 85f103066c
2 changed files with 9 additions and 2 deletions

8
app.py
View file

@ -1,6 +1,6 @@
from deemix.app.queuemanager import addToQueue, removeFromQueue, getQueue, cancelAllDownloads, removeFinishedDownloads
from deemix.utils.misc import getTypeFromLink, getIDFromLink
from deemix.app.settings import initSettings, getSettings, saveSettings
from deemix.app.settings import initSettings, getSettings, getDefaultSettings, saveSettings
from deemix.app.spotify import SpotifyHelper
settings = {}
@ -15,7 +15,9 @@ def getUser(dz):
def initialize():
global settings
global spotifyHelper
global defaultSettings
settings = initSettings()
defaultSettings = getDefaultSettings()
spotifyHelper = SpotifyHelper()
@ -80,6 +82,10 @@ def analyzeLink(dz, link):
return (type, data)
# Settings functions
def getDefaultSettings_link():
return defaultSettings
def getSettings_link():
return getSettings()

View file

@ -65,7 +65,8 @@ def on_connect():
session['dz'] = Deezer()
settings = app.getSettings_link()
spotifyCredentials = app.getSpotifyCredentials()
emit('init_settings', (settings, spotifyCredentials))
defaultSettings = app.getDefaultSettings_link()
emit('init_settings', (settings, spotifyCredentials, defaultSettings))
queue, queueComplete, queueList, currentItem = app.getQueue_link()
emit('init_downloadQueue',
{'queue': queue, 'queueComplete': queueComplete, 'queueList': queueList, 'currentItem': currentItem})