mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 15:15:57 -05:00
[web] Remove unnecessary word option
This commit is contained in:
parent
30fc35097c
commit
73040780b9
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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(() => {
|
||||
|
@ -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(() => {
|
||||
|
@ -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(() => {
|
||||
|
@ -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',
|
||||
|
@ -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
|
||||
|
@ -123,7 +123,7 @@
|
||||
<settings-textfield
|
||||
category_name="webinterface"
|
||||
option_name="show_composer_for_genre"
|
||||
:disabled="!settings_option_show_composer_now_playing"
|
||||
:disabled="!setting_show_composer_now_playing"
|
||||
:placeholder="$t('page.settings.general.genres')"
|
||||
>
|
||||
<template #label>
|
||||
@ -225,11 +225,11 @@ export default {
|
||||
}))
|
||||
}
|
||||
},
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,23 +71,23 @@ export default createStore({
|
||||
getters: {
|
||||
now_playing: (state) =>
|
||||
state.queue.items.find((e) => e.id === state.player.item_id) ?? {},
|
||||
settings_option: (state) => (categoryName, optionName) =>
|
||||
setting: (state) => (categoryName, optionName) =>
|
||||
state.settings.categories
|
||||
.find((category) => category.name === categoryName)
|
||||
?.options.find((option) => option.name === optionName) ?? {},
|
||||
settings_option_recently_added_limit: (state, getters) =>
|
||||
setting_recently_added_limit: (state, getters) =>
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'recently_added_limit'
|
||||
)?.value ?? 100,
|
||||
settings_option_show_composer_for_genre: (state, getters) =>
|
||||
setting_show_composer_for_genre: (state, getters) =>
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'show_composer_for_genre'
|
||||
)?.value ?? null,
|
||||
settings_option_show_composer_now_playing: (state, getters) =>
|
||||
setting_show_composer_now_playing: (state, getters) =>
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'show_composer_now_playing'
|
||||
)?.value ?? false,
|
||||
settings_option_show_filepath_now_playing: (state, getters) =>
|
||||
setting_show_filepath_now_playing: (state, getters) =>
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'show_filepath_now_playing'
|
||||
)?.value ?? false,
|
||||
@ -225,7 +225,7 @@ export default createStore({
|
||||
state.recent_searches.splice(index, 1)
|
||||
}
|
||||
},
|
||||
update_settings_option({ state }, option) {
|
||||
update_setting({ state }, option) {
|
||||
const settingCategory = state.settings.categories.find(
|
||||
(e) => e.name === option.category
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user