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)