From 85f103066c2de4ff0040211a28407d639f25ef54 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sun, 3 May 2020 16:21:37 +0200 Subject: [PATCH] Implemented reset settings and added missing options Tags selection not added yet --- app.py | 8 +++++++- server.py | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 6721618..97372a7 100644 --- a/app.py +++ b/app.py @@ -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() diff --git a/server.py b/server.py index a8e60b2..16ab210 100644 --- a/server.py +++ b/server.py @@ -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})