[web] Remove unnecessary word option

This commit is contained in:
Alain Nussbaumer
2024-04-25 22:36:04 +02:00
parent 30fc35097c
commit 73040780b9
10 changed files with 46 additions and 78 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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(() => {

View File

@@ -16,7 +16,7 @@
inputmode="numeric"
min="0"
:placeholder="placeholder"
:value="value"
:value="option.value"
@input="set_update_timer"
/>
</div>
@@ -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(() => {

View File

@@ -15,7 +15,7 @@
class="input"
type="text"
:placeholder="placeholder"
:value="value"
:value="option.value"
@input="set_update_timer"
/>
</div>
@@ -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(() => {