2021-09-23 03:40:35 +02:00
|
|
|
<template>
|
|
|
|
<div class="page" :class="streamAudiobook ? 'streaming' : ''">
|
|
|
|
<div class="flex h-full">
|
2021-11-04 23:35:59 +01:00
|
|
|
<app-side-rail class="hidden md:block" />
|
2021-09-23 03:40:35 +02:00
|
|
|
<div class="flex-grow">
|
2021-12-02 02:07:03 +01:00
|
|
|
<app-book-shelf-toolbar :page="id || ''" :view-mode.sync="viewMode" />
|
|
|
|
<app-lazy-bookshelf :page="id || ''" :view-mode="viewMode" />
|
2021-09-23 03:40:35 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2021-10-05 05:11:42 +02:00
|
|
|
async asyncData({ params, query, store, app, redirect }) {
|
|
|
|
var libraryId = params.library
|
|
|
|
var library = await store.dispatch('libraries/fetch', libraryId)
|
|
|
|
if (!library) {
|
|
|
|
return redirect('/oops?message=Library not found')
|
|
|
|
}
|
|
|
|
|
2021-10-17 18:29:52 +02:00
|
|
|
// Set filter by
|
2021-09-24 14:32:38 +02:00
|
|
|
if (query.filter) {
|
|
|
|
store.dispatch('user/updateUserSettings', { filterBy: query.filter })
|
|
|
|
}
|
2021-09-23 03:40:35 +02:00
|
|
|
return {
|
2021-12-02 02:07:03 +01:00
|
|
|
id: params.id || '',
|
|
|
|
libraryId
|
2021-09-23 03:40:35 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
2021-10-30 03:42:28 +02:00
|
|
|
return {
|
|
|
|
viewMode: 'grid'
|
|
|
|
}
|
2021-09-23 03:40:35 +02:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
streamAudiobook() {
|
|
|
|
return this.$store.state.streamAudiobook
|
|
|
|
}
|
|
|
|
},
|
2021-12-02 02:07:03 +01:00
|
|
|
methods: {}
|
2021-09-23 03:40:35 +02:00
|
|
|
}
|
|
|
|
</script>
|