[settings] add webinterface.recently_added_limit

This commit is contained in:
whatdoineed2do/Ray 2020-12-01 15:58:40 +00:00 committed by chme
parent eacb6a17eb
commit 5eeadd3f1b
3 changed files with 25 additions and 1 deletions

View File

@ -37,6 +37,7 @@ static struct settings_option webinterface_options[] =
{ "show_menu_item_radio", SETTINGS_TYPE_BOOL, { false } },
{ "show_menu_item_files", SETTINGS_TYPE_BOOL, { true } },
{ "show_menu_item_search", SETTINGS_TYPE_BOOL, { true } },
{ "recently_added_limit", SETTINGS_TYPE_INT, { 100 } },
};
static struct settings_option artwork_options[] =

View File

@ -80,6 +80,18 @@
</settings-textfield>
</template>
</content-with-heading>
<content-with-heading>
<template slot="heading-left">
<div class="title is-4">Recently Added</div>
</template>
<template slot="content">
<settings-intfield category_name="webinterface" option_name="recently_added_limit">
<template slot="label"> Limit on number of albums to show on 'Recently Added' page</template>
</settings-intfield>
</template>
</content-with-heading>
</div>
</template>
@ -88,10 +100,11 @@ import ContentWithHeading from '@/templates/ContentWithHeading'
import TabsSettings from '@/components/TabsSettings'
import SettingsCheckbox from '@/components/SettingsCheckbox'
import SettingsTextfield from '@/components/SettingsTextfield'
import SettingsIntfield from '@/components/SettingsIntfield'
export default {
name: 'SettingsPageWebinterface',
components: { ContentWithHeading, TabsSettings, SettingsCheckbox, SettingsTextfield },
components: { ContentWithHeading, TabsSettings, SettingsCheckbox, SettingsTextfield, SettingsIntfield },
computed: {
settings_option_show_composer_now_playing () {

View File

@ -77,6 +77,16 @@ export default new Vuex.Store({
return null
},
settings_option_recently_added_limit: (state, getters) => {
if (getters.settings_webinterface) {
const option = getters.settings_webinterface.options.find(elem => elem.name === 'recently_added_limit')
if (option) {
return option.value
}
}
return 100
},
settings_option_show_composer_now_playing: (state, getters) => {
if (getters.settings_webinterface) {
const option = getters.settings_webinterface.options.find(elem => elem.name === 'show_composer_now_playing')