diff --git a/web-src/src/components/ListAlbums.vue b/web-src/src/components/ListAlbums.vue index c674b52c..9fee1572 100644 --- a/web-src/src/components/ListAlbums.vue +++ b/web-src/src/components/ListAlbums.vue @@ -94,7 +94,7 @@ export default { return this.media_kind || this.selected_item.media_kind }, show_artwork() { - return this.$store.getters.settings_option( + return this.$store.getters.setting( 'webinterface', 'show_cover_artwork_in_album_lists' ).value diff --git a/web-src/src/components/ListAlbumsSpotify.vue b/web-src/src/components/ListAlbumsSpotify.vue index 1684f4d7..08c22044 100644 --- a/web-src/src/components/ListAlbumsSpotify.vue +++ b/web-src/src/components/ListAlbumsSpotify.vue @@ -53,7 +53,7 @@ export default { computed: { show_artwork() { - return this.$store.getters.settings_option( + return this.$store.getters.setting( 'webinterface', 'show_cover_artwork_in_album_lists' ).value diff --git a/web-src/src/components/NavbarTop.vue b/web-src/src/components/NavbarTop.vue index ef7f77c8..42257041 100644 --- a/web-src/src/components/NavbarTop.vue +++ b/web-src/src/components/NavbarTop.vue @@ -138,7 +138,7 @@ export default { } }, show_audiobooks() { - return this.$store.getters.settings_option( + return this.$store.getters.setting( 'webinterface', 'show_menu_item_audiobooks' ).value @@ -152,40 +152,34 @@ export default { } }, show_files() { - return this.$store.getters.settings_option( - 'webinterface', - 'show_menu_item_files' - ).value + return this.$store.getters.setting('webinterface', 'show_menu_item_files') + .value }, show_music() { - return this.$store.getters.settings_option( - 'webinterface', - 'show_menu_item_music' - ).value + return this.$store.getters.setting('webinterface', 'show_menu_item_music') + .value }, show_player_menu() { return this.$store.state.show_player_menu }, show_playlists() { - return this.$store.getters.settings_option( + return this.$store.getters.setting( 'webinterface', 'show_menu_item_playlists' ).value }, show_podcasts() { - return this.$store.getters.settings_option( + return this.$store.getters.setting( 'webinterface', 'show_menu_item_podcasts' ).value }, show_radio() { - return this.$store.getters.settings_option( - 'webinterface', - 'show_menu_item_radio' - ).value + return this.$store.getters.setting('webinterface', 'show_menu_item_radio') + .value }, show_search() { - return this.$store.getters.settings_option( + return this.$store.getters.setting( 'webinterface', 'show_menu_item_search' ).value diff --git a/web-src/src/components/SettingsCheckbox.vue b/web-src/src/components/SettingsCheckbox.vue index b4f306be..5feb1970 100644 --- a/web-src/src/components/SettingsCheckbox.vue +++ b/web-src/src/components/SettingsCheckbox.vue @@ -55,7 +55,7 @@ export default { return this.statusUpdate === 'success' }, option() { - const option = this.$store.getters.settings_option( + const option = this.$store.getters.setting( this.category_name, this.option_name ) @@ -87,7 +87,7 @@ export default { webapi .settings_update(this.category_name, option) .then(() => { - this.$store.dispatch('update_settings_option', option) + this.$store.dispatch('update_setting', option) this.statusUpdate = 'success' }) .catch(() => { diff --git a/web-src/src/components/SettingsIntfield.vue b/web-src/src/components/SettingsIntfield.vue index 9e0aec93..b2f83d2f 100644 --- a/web-src/src/components/SettingsIntfield.vue +++ b/web-src/src/components/SettingsIntfield.vue @@ -16,7 +16,7 @@ inputmode="numeric" min="0" :placeholder="placeholder" - :value="value" + :value="option.value" @input="set_update_timer" /> @@ -48,11 +48,6 @@ export default { }, computed: { - category() { - return this.$store.state.settings.categories.find( - (elem) => elem.name === this.category_name - ) - }, info() { if (this.statusUpdate === 'success') { return this.$t('setting.saved') @@ -68,15 +63,7 @@ export default { return this.statusUpdate === 'success' }, option() { - if (!this.category) { - return {} - } - return this.category.options.find( - (elem) => elem.name === this.option_name - ) - }, - value() { - return this.option.value + return this.$store.getters.setting(this.category_name, this.option_name) } }, @@ -101,14 +88,14 @@ export default { return } const option = { - category: this.category.name, + category: this.category_name, name: this.option_name, value: newValue } webapi - .settings_update(this.category.name, option) + .settings_update(this.category_name, option) .then(() => { - this.$store.dispatch('update_settings_option', option) + this.$store.dispatch('update_setting', option) this.statusUpdate = 'success' }) .catch(() => { diff --git a/web-src/src/components/SettingsTextfield.vue b/web-src/src/components/SettingsTextfield.vue index cd7618f0..b5a778fe 100644 --- a/web-src/src/components/SettingsTextfield.vue +++ b/web-src/src/components/SettingsTextfield.vue @@ -15,7 +15,7 @@ class="input" type="text" :placeholder="placeholder" - :value="value" + :value="option.value" @input="set_update_timer" /> @@ -47,11 +47,6 @@ export default { }, computed: { - category() { - return this.$store.state.settings.categories.find( - (elem) => elem.name === this.category_name - ) - }, info() { if (this.statusUpdate === 'success') { return this.$t('setting.saved') @@ -67,15 +62,7 @@ export default { return this.statusUpdate === 'success' }, option() { - if (!this.category) { - return {} - } - return this.category.options.find( - (elem) => elem.name === this.option_name - ) - }, - value() { - return this.option.value + return this.$store.getters.setting(this.category_name, this.option_name) } }, @@ -102,14 +89,14 @@ export default { return } const option = { - category: this.category.name, + category: this.category_name, name: this.option_name, value: newValue } webapi - .settings_update(this.category.name, option) + .settings_update(this.category_name, option) .then(() => { - this.$store.dispatch('update_settings_option', option) + this.$store.dispatch('update_setting', option) this.statusUpdate = 'success' }) .catch(() => { diff --git a/web-src/src/pages/PageMusicRecentlyAdded.vue b/web-src/src/pages/PageMusicRecentlyAdded.vue index 2de6f9cf..b1563a34 100644 --- a/web-src/src/pages/PageMusicRecentlyAdded.vue +++ b/web-src/src/pages/PageMusicRecentlyAdded.vue @@ -22,7 +22,7 @@ import webapi from '@/webapi' const dataObject = { load(to) { - const limit = store.getters.settings_option_recently_added_limit + const limit = store.getters.setting_recently_added_limit return webapi.search({ expression: 'media_kind is music having track_count > 3 order by time_added desc', diff --git a/web-src/src/pages/PageNowPlaying.vue b/web-src/src/pages/PageNowPlaying.vue index 31d4244f..842fad86 100644 --- a/web-src/src/pages/PageNowPlaying.vue +++ b/web-src/src/pages/PageNowPlaying.vue @@ -87,11 +87,11 @@ export default { computed: { composer() { - if (this.settings_option_show_composer_now_playing) { + if (this.setting_show_composer_now_playing) { if ( - !this.settings_option_show_composer_for_genre || + !this.setting_show_composer_for_genre || (this.track.genre && - this.settings_option_show_composer_for_genre + this.setting_show_composer_for_genre .toLowerCase() .split(',') .findIndex( @@ -105,7 +105,7 @@ export default { return null }, filepath() { - if (this.settings_option_show_filepath_now_playing) { + if (this.setting_show_filepath_now_playing) { return this.track.path } return null @@ -119,14 +119,14 @@ export default { player() { return this.$store.state.player }, - settings_option_show_composer_for_genre() { - return this.$store.getters.settings_option_show_composer_for_genre + setting_show_composer_for_genre() { + return this.$store.getters.setting_show_composer_for_genre }, - settings_option_show_composer_now_playing() { - return this.$store.getters.settings_option_show_composer_now_playing + setting_show_composer_now_playing() { + return this.$store.getters.setting_show_composer_now_playing }, - settings_option_show_filepath_now_playing() { - return this.$store.getters.settings_option_show_filepath_now_playing + setting_show_filepath_now_playing() { + return this.$store.getters.setting_show_filepath_now_playing }, track() { return this.$store.getters.now_playing diff --git a/web-src/src/pages/PageSettingsWebinterface.vue b/web-src/src/pages/PageSettingsWebinterface.vue index 1a507192..79409f7b 100644 --- a/web-src/src/pages/PageSettingsWebinterface.vue +++ b/web-src/src/pages/PageSettingsWebinterface.vue @@ -123,7 +123,7 @@