2021-12-02 02:07:03 +01:00
|
|
|
<template>
|
2025-02-07 02:29:08 +01:00
|
|
|
<div id="page-wrapper" class="page" :class="streamLibraryItem ? 'streaming' : ''">
|
|
|
|
<app-book-shelf-toolbar id="series-toolbar" :selected-series="series" />
|
|
|
|
<div class="max-w-6xl mx-auto">
|
|
|
|
<div class="flex items-center my-8">
|
|
|
|
<h1 class="text-2xl">{{ series.name }}</h1>
|
|
|
|
|
|
|
|
<button class="w-8 h-8 rounded-full flex items-center justify-center mx-4 cursor-pointer text-gray-300 hover:text-warning transform hover:scale-125 duration-100" @click="showEditSeries">
|
|
|
|
<span class="material-symbols text-base">edit</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2025-02-08 02:01:27 +01:00
|
|
|
<div class="mb-6">
|
|
|
|
<h2 class="font-semibold">
|
|
|
|
{{ $strings.LabelDescription }}
|
|
|
|
</h2>
|
|
|
|
<div>{{ series.description }}</div>
|
|
|
|
</div>
|
2025-02-07 02:29:08 +01:00
|
|
|
<app-lazy-bookshelf page="series-books" :series-id="seriesId" />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<modals-edit-series-modal v-model="showEditSeriesModal" :series="series" />
|
2021-12-02 02:07:03 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
async asyncData({ store, params, redirect, query, app }) {
|
2022-12-31 23:58:19 +01:00
|
|
|
const libraryId = params.library
|
|
|
|
const libraryData = await store.dispatch('libraries/fetch', libraryId)
|
2022-04-14 19:57:34 +02:00
|
|
|
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}`)
|
|
|
|
}
|
|
|
|
|
2023-07-08 00:59:17 +02:00
|
|
|
const series = await app.$axios.$get(`/api/libraries/${library.id}/series/${params.id}?include=progress,rssfeed`).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() {
|
2025-02-07 02:29:08 +01:00
|
|
|
return {
|
|
|
|
showEditSeriesModal: false
|
|
|
|
}
|
2021-12-02 02:07:03 +01:00
|
|
|
},
|
|
|
|
computed: {
|
2022-03-14 01:34:31 +01:00
|
|
|
streamLibraryItem() {
|
|
|
|
return this.$store.state.streamLibraryItem
|
2021-12-02 02:07:03 +01:00
|
|
|
}
|
|
|
|
},
|
2022-09-28 00:48:45 +02:00
|
|
|
methods: {
|
|
|
|
seriesUpdated(series) {
|
|
|
|
this.series = series
|
2025-02-07 02:29:08 +01:00
|
|
|
},
|
|
|
|
showEditSeries() {
|
|
|
|
this.showEditSeriesModal = !this.showEditSeriesModal
|
2022-09-28 00:48:45 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
if (this.$root.socket) {
|
|
|
|
this.$root.socket.on('series_updated', this.seriesUpdated)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
if (this.$root.socket) {
|
|
|
|
this.$root.socket.off('series_updated', this.seriesUpdated)
|
|
|
|
}
|
|
|
|
}
|
2021-12-02 02:07:03 +01:00
|
|
|
}
|
|
|
|
</script>
|
2025-02-07 02:29:08 +01:00
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
#bookshelf {
|
|
|
|
background-image: none;
|
|
|
|
}
|
|
|
|
#series-toolbar {
|
|
|
|
background-color: rgba(55, 56, 56, 1);
|
|
|
|
}
|
|
|
|
</style>
|