[web-src] Audiobooks index list

This commit is contained in:
chme 2020-09-27 19:22:33 +02:00
parent f4f80f3508
commit 886754e6ad
6 changed files with 16 additions and 8 deletions

View File

@ -14,7 +14,7 @@
<router-link tag="li" to="/audiobooks/albums" active-class="is-active"> <router-link tag="li" to="/audiobooks/albums" active-class="is-active">
<a> <a>
<span class="icon is-small"><i class="mdi mdi-album"></i></span> <span class="icon is-small"><i class="mdi mdi-album"></i></span>
<span class="">Albums</span> <span class="">Audiobooks</span>
</a> </a>
</router-link> </router-link>
</ul> </ul>

View File

@ -80,8 +80,7 @@ export default {
watch: { watch: {
'hide_singles' () { 'hide_singles' () {
this.index_list = [...new Set(this.albums.items this.index_list = [...new Set(this.albums_filtered
.filter(album => !this.$store.state.hide_singles || album.track_count > 2)
.map(album => album.name_sort.charAt(0).toUpperCase()))] .map(album => album.name_sort.charAt(0).toUpperCase()))]
} }
} }

View File

@ -61,8 +61,7 @@ export default {
}, },
index_list () { index_list () {
return [...new Set(this.artists.items return [...new Set(this.artists_filtered
.filter(artist => !this.$store.state.hide_singles || artist.track_count > (artist.album_count * 2))
.map(artist => artist.name_sort.charAt(0).toUpperCase()))] .map(artist => artist.name_sort.charAt(0).toUpperCase()))]
}, },

View File

@ -3,6 +3,9 @@
<tabs-audiobooks></tabs-audiobooks> <tabs-audiobooks></tabs-audiobooks>
<content-with-heading> <content-with-heading>
<template slot="options">
<index-button-list :index="index_list"></index-button-list>
</template>
<template slot="heading-left"> <template slot="heading-left">
<p class="title is-4">Audiobooks</p> <p class="title is-4">Audiobooks</p>
<p class="heading">{{ albums.total }} audiobooks</p> <p class="heading">{{ albums.total }} audiobooks</p>
@ -17,6 +20,7 @@
<script> <script>
import { LoadDataBeforeEnterMixin } from './mixin' import { LoadDataBeforeEnterMixin } from './mixin'
import TabsAudiobooks from '@/components/TabsAudiobooks' import TabsAudiobooks from '@/components/TabsAudiobooks'
import IndexButtonList from '@/components/IndexButtonList'
import ContentWithHeading from '@/templates/ContentWithHeading' import ContentWithHeading from '@/templates/ContentWithHeading'
import ListAlbums from '@/components/ListAlbums' import ListAlbums from '@/components/ListAlbums'
import webapi from '@/webapi' import webapi from '@/webapi'
@ -34,7 +38,7 @@ const albumsData = {
export default { export default {
name: 'PageAudiobooksAlbums', name: 'PageAudiobooksAlbums',
mixins: [LoadDataBeforeEnterMixin(albumsData)], mixins: [LoadDataBeforeEnterMixin(albumsData)],
components: { TabsAudiobooks, ContentWithHeading, ListAlbums }, components: { TabsAudiobooks, ContentWithHeading, IndexButtonList, ListAlbums },
data () { data () {
return { return {
@ -42,6 +46,13 @@ export default {
} }
}, },
computed: {
index_list () {
return [...new Set(this.albums.items
.map(album => album.name_sort.charAt(0).toUpperCase()))]
}
},
methods: { methods: {
} }
} }

View File

@ -51,7 +51,6 @@ export default {
computed: { computed: {
index_list () { index_list () {
return [...new Set(this.artists.items return [...new Set(this.artists.items
.filter(artist => !this.$store.state.hide_singles || artist.track_count > (artist.album_count * 2))
.map(artist => artist.name_sort.charAt(0).toUpperCase()))] .map(artist => artist.name_sort.charAt(0).toUpperCase()))]
} }
}, },

View File

@ -160,7 +160,7 @@ export const router = new VueRouter({
path: '/audiobooks/albums', path: '/audiobooks/albums',
name: 'AudiobooksAlbums', name: 'AudiobooksAlbums',
component: PageAudiobooksAlbums, component: PageAudiobooksAlbums,
meta: { show_progress: true, has_tabs: true } meta: { show_progress: true, has_tabs: true, has_index: true }
}, },
{ {
path: '/audiobooks/:album_id', path: '/audiobooks/:album_id',