[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">
<a>
<span class="icon is-small"><i class="mdi mdi-album"></i></span>
<span class="">Albums</span>
<span class="">Audiobooks</span>
</a>
</router-link>
</ul>

View File

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

View File

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

View File

@ -3,6 +3,9 @@
<tabs-audiobooks></tabs-audiobooks>
<content-with-heading>
<template slot="options">
<index-button-list :index="index_list"></index-button-list>
</template>
<template slot="heading-left">
<p class="title is-4">Audiobooks</p>
<p class="heading">{{ albums.total }} audiobooks</p>
@ -17,6 +20,7 @@
<script>
import { LoadDataBeforeEnterMixin } from './mixin'
import TabsAudiobooks from '@/components/TabsAudiobooks'
import IndexButtonList from '@/components/IndexButtonList'
import ContentWithHeading from '@/templates/ContentWithHeading'
import ListAlbums from '@/components/ListAlbums'
import webapi from '@/webapi'
@ -34,7 +38,7 @@ const albumsData = {
export default {
name: 'PageAudiobooksAlbums',
mixins: [LoadDataBeforeEnterMixin(albumsData)],
components: { TabsAudiobooks, ContentWithHeading, ListAlbums },
components: { TabsAudiobooks, ContentWithHeading, IndexButtonList, ListAlbums },
data () {
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: {
}
}

View File

@ -51,7 +51,6 @@ export default {
computed: {
index_list () {
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()))]
}
},

View File

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