2018-08-11 01:47:10 -04:00
|
|
|
<template>
|
|
|
|
<div>
|
2020-07-01 01:29:03 -04:00
|
|
|
<tabs-audiobooks></tabs-audiobooks>
|
|
|
|
|
2018-08-11 01:47:10 -04:00
|
|
|
<content-with-heading>
|
2020-09-27 13:22:33 -04:00
|
|
|
<template slot="options">
|
2020-10-08 00:01:17 -04:00
|
|
|
<index-button-list :index="albums_list.indexList"></index-button-list>
|
2020-09-27 13:22:33 -04:00
|
|
|
</template>
|
2018-08-11 01:47:10 -04:00
|
|
|
<template slot="heading-left">
|
|
|
|
<p class="title is-4">Audiobooks</p>
|
2020-10-08 00:01:17 -04:00
|
|
|
<p class="heading">{{ albums_list.sortedAndFiltered.length }} Audiobooks</p>
|
2018-08-11 01:47:10 -04:00
|
|
|
</template>
|
|
|
|
<template slot="content">
|
2020-10-08 00:01:17 -04:00
|
|
|
<list-albums :albums="albums_list"></list-albums>
|
2018-08-11 01:47:10 -04:00
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
2020-07-01 01:29:03 -04:00
|
|
|
import TabsAudiobooks from '@/components/TabsAudiobooks'
|
2020-09-27 13:22:33 -04:00
|
|
|
import IndexButtonList from '@/components/IndexButtonList'
|
2018-08-11 01:47:10 -04:00
|
|
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
2020-09-20 02:13:19 -04:00
|
|
|
import ListAlbums from '@/components/ListAlbums'
|
2018-08-11 01:47:10 -04:00
|
|
|
import webapi from '@/webapi'
|
2020-10-08 00:01:17 -04:00
|
|
|
import Albums from '@/lib/Albums'
|
2018-08-11 01:47:10 -04:00
|
|
|
|
|
|
|
const albumsData = {
|
|
|
|
load: function (to) {
|
2020-06-30 04:24:11 -04:00
|
|
|
return webapi.library_albums('audiobook')
|
2018-08-11 01:47:10 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
set: function (vm, response) {
|
|
|
|
vm.albums = response.data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
2020-09-20 02:15:46 -04:00
|
|
|
name: 'PageAudiobooksAlbums',
|
2020-04-11 13:43:53 -04:00
|
|
|
mixins: [LoadDataBeforeEnterMixin(albumsData)],
|
2020-09-27 13:22:33 -04:00
|
|
|
components: { TabsAudiobooks, ContentWithHeading, IndexButtonList, ListAlbums },
|
2018-08-11 01:47:10 -04:00
|
|
|
|
|
|
|
data () {
|
|
|
|
return {
|
2020-09-20 02:13:19 -04:00
|
|
|
albums: { items: [] }
|
2018-12-15 03:56:09 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2020-09-27 13:22:33 -04:00
|
|
|
computed: {
|
2020-10-08 00:01:17 -04:00
|
|
|
albums_list () {
|
|
|
|
return new Albums(this.albums.items, {
|
|
|
|
sort: 'Name',
|
|
|
|
group: true
|
|
|
|
})
|
2020-09-27 13:22:33 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-12-15 03:56:09 -05:00
|
|
|
methods: {
|
2018-08-11 01:47:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|