2021-12-02 02:07:03 +01:00
|
|
|
<template>
|
2022-03-14 01:34:31 +01:00
|
|
|
<div class="page" :class="streamLibraryItem ? 'streaming' : ''">
|
2022-05-14 00:40:43 +02:00
|
|
|
<app-book-shelf-toolbar :selected-series="series" />
|
|
|
|
<app-lazy-bookshelf page="series-books" :series-id="seriesId" />
|
2021-12-02 02:07:03 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
async asyncData({ store, params, redirect, query, app }) {
|
|
|
|
var libraryId = params.library
|
2022-04-14 19:57:34 +02:00
|
|
|
var libraryData = await store.dispatch('libraries/fetch', libraryId)
|
|
|
|
if (!libraryData) {
|
2021-12-02 02:07:03 +01:00
|
|
|
return redirect('/oops?message=Library not found')
|
|
|
|
}
|
2022-04-14 19:57:34 +02:00
|
|
|
|
|
|
|
const library = libraryData.library
|
|
|
|
if (library.mediaType === 'podcast') {
|
|
|
|
return redirect(`/library/${libraryId}`)
|
|
|
|
}
|
|
|
|
|
2022-04-25 00:46:21 +02:00
|
|
|
var series = await app.$axios.$get(`/api/series/${params.id}?include=progress`).catch((error) => {
|
2022-03-13 01:50:31 +01:00
|
|
|
console.error('Failed', error)
|
|
|
|
return false
|
|
|
|
})
|
|
|
|
if (!series) {
|
|
|
|
return redirect('/oops?message=Series not found')
|
|
|
|
}
|
2021-12-02 02:07:03 +01:00
|
|
|
|
|
|
|
return {
|
2022-04-25 00:46:21 +02:00
|
|
|
series,
|
2021-12-02 02:07:03 +01:00
|
|
|
seriesId: params.id
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {}
|
|
|
|
},
|
|
|
|
computed: {
|
2022-03-14 01:34:31 +01:00
|
|
|
streamLibraryItem() {
|
|
|
|
return this.$store.state.streamLibraryItem
|
2021-12-02 02:07:03 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {},
|
|
|
|
beforeDestroy() {}
|
|
|
|
}
|
|
|
|
</script>
|