excluded podcasts for now

excluded podcasts for now as we cannot get all episodes of a library currently with few requests (afaik)
This commit is contained in:
Vito0912 2024-08-25 17:50:47 +02:00
parent d4a5955cbc
commit d55ed05672
No known key found for this signature in database
GPG key ID: 29A3D509FE70B237
2 changed files with 24 additions and 16 deletions

View file

@ -123,15 +123,21 @@ export default {
title: this.$strings.HeaderYourStats, title: this.$strings.HeaderYourStats,
path: '/config/stats' path: '/config/stats'
}) })
if(this.currentLibraryMediaType === 'book')
{
configRoutes.push({ configRoutes.push({
id: 'config-to-go', id: 'config-to-go',
title: this.$strings.HeaderToGo, title: this.$strings.HeaderToGo,
path: '/config/to-go' path: '/config/to-go'
}) })
} }
}
return configRoutes return configRoutes
}, },
currentLibraryMediaType() {
return this.$store.getters['libraries/getCurrentLibraryMediaType']
},
wrapperClass() { wrapperClass() {
var classes = [] var classes = []
if (this.drawerOpen) classes.push('translate-x-0') if (this.drawerOpen) classes.push('translate-x-0')

View file

@ -116,8 +116,13 @@
</template> </template>
<script> <script>export default {
export default { asyncData({ redirect, store }) {
if(store.getters['libraries/getCurrentLibraryMediaType'] !== 'book') {
redirect(`/library/${store.state.libraries.currentLibraryId}`)
}
return {}
},
data() { data() {
return { return {
items: null, items: null,
@ -132,6 +137,9 @@ export default {
if (newVal) { if (newVal) {
this.init() this.init()
this.resetValues() this.resetValues()
if(this.getCurrentLibraryMediaType !== 'book') {
this.$router.push(`/config`)
}
} }
} }
}, },
@ -148,6 +156,9 @@ export default {
currentLibraryId() { currentLibraryId() {
return this.$store.state.libraries.currentLibraryId return this.$store.state.libraries.currentLibraryId
}, },
getCurrentLibraryMediaType() {
return this.$store.getters['libraries/getCurrentLibraryMediaType']
},
mediaProgress() { mediaProgress() {
return [...this.user.mediaProgress].sort((a, b) => b.lastUpdate - a.lastUpdate); return [...this.user.mediaProgress].sort((a, b) => b.lastUpdate - a.lastUpdate);
}, },
@ -176,15 +187,6 @@ export default {
} }
}, },
unfinishedStartedItems() { unfinishedStartedItems() {
console.log(
this.currentMediaProgress
.map((mp) => {
const item = this.items.find(item => item.id === mp.libraryItemId);
return { ...item, mediaProgress: mp };
})
.filter((item) => !item.mediaProgress.isFinished || item.mediaProgress.progress < 1)
.sort((a, b) => b.mediaProgress.progress - a.mediaProgress.progress)[0]
)
return this.currentMediaProgress return this.currentMediaProgress
.map((mp) => { .map((mp) => {
const item = this.items.find(item => item.id === mp.libraryItemId); const item = this.items.find(item => item.id === mp.libraryItemId);