From 24146b37b3f17d5a64048260a9951a9b1ca44ec5 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 --- public/index.html | 42 +++++++++++++++++++- public/js/modules/components/settings-tab.js | 15 ++++--- 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/public/index.html b/public/index.html index eb3ae4d..a2f3da7 100644 --- a/public/index.html +++ b/public/index.html @@ -421,7 +421,7 @@

Settings

-

ARL

+

Login

+
+

Use null separator

+ +
+
+

Save ID3v1 as well

+ +
+
+

How would you like to separate your artists?

+ +

Remove album version from track title

+
+

Date format for FLAC files

+ +

What should I do with featured artists

+
+

Command to execute after download

+

Leave blank for no action

+ +
@@ -630,7 +667,8 @@

Folders

diff --git a/public/js/modules/components/settings-tab.js b/public/js/modules/components/settings-tab.js index 1fe8265..ee4ad9b 100644 --- a/public/js/modules/components/settings-tab.js +++ b/public/js/modules/components/settings-tab.js @@ -7,7 +7,8 @@ const SettingsTab = new Vue({ settings: { tags: {} }, lastSettings: {}, lastCredentials: {}, - spotifyFeatures: {} + spotifyFeatures: {}, + defaultSettings: {} } }, methods: { @@ -27,7 +28,8 @@ const SettingsTab = new Vue({ this.lastCredentials = { ...SettingsTab.spotifyFeatures } socket.emit('saveSettings', this.lastSettings, this.lastCredentials) }, - loadSettings(settings, spotifyCredentials) { + loadSettings(settings, spotifyCredentials, defaults=null) { + if (defaults) this.defaultSettings = { ...defaults } this.lastSettings = { ...settings } this.lastCredentials = { ...spotifyCredentials } this.settings = settings @@ -42,14 +44,17 @@ const SettingsTab = new Vue({ logout() { socket.emit('logout') }, - initSettings(settings, credentials) { - this.loadSettings(settings, credentials) + initSettings(settings, credentials, defaults) { + this.loadSettings(settings, credentials, defaults) toast('Settings loaded!', 'settings') }, updateSettings(settings, credentials) { this.loadSettings(settings, credentials) toast('Settings updated!', 'settings') - } + }, + resetSettings(){ + this.settings = { ...this.defaultSettings } + } }, mounted() { socket.on('init_settings', this.initSettings)