[web] Add index for radio stations

This commit is contained in:
Alain Nussbaumer 2025-04-27 09:05:09 +02:00
parent c38f35d3f9
commit 56c9408ef9

View File

@ -1,5 +1,8 @@
<template> <template>
<content-with-heading> <content-with-heading>
<template #options>
<list-index-buttons :indices="tracks.indices" />
</template>
<template #heading> <template #heading>
<heading-title :content="heading" /> <heading-title :content="heading" />
</template> </template>
@ -13,16 +16,24 @@
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import { GroupedList } from '@/lib/GroupedList' import { GroupedList } from '@/lib/GroupedList'
import HeadingTitle from '@/components/HeadingTitle.vue' import HeadingTitle from '@/components/HeadingTitle.vue'
import ListIndexButtons from '@/components/ListIndexButtons.vue'
import ListTracks from '@/components/ListTracks.vue' import ListTracks from '@/components/ListTracks.vue'
import webapi from '@/webapi' import webapi from '@/webapi'
export default { export default {
name: 'PageRadioStreams', name: 'PageRadioStreams',
components: { ContentWithHeading, HeadingTitle, ListTracks }, components: {
ContentWithHeading,
HeadingTitle,
ListIndexButtons,
ListTracks
},
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
webapi.library_radio_streams().then((tracks) => { webapi.library_radio_streams().then((tracks) => {
next((vm) => { next((vm) => {
vm.tracks = new GroupedList(tracks) vm.tracks = new GroupedList(tracks, {
index: { field: 'title_sort', type: String }
})
}) })
}) })
}, },