diff --git a/components/bookshelf/LazyBookshelf.vue b/components/bookshelf/LazyBookshelf.vue index d3db9dea..d0def2a6 100644 --- a/components/bookshelf/LazyBookshelf.vue +++ b/components/bookshelf/LazyBookshelf.vue @@ -395,6 +395,11 @@ export default { } }, libraryChanged() { + if (this.currentLibraryMediaType !== 'book' && (this.page === 'series' || this.page === 'collections' || this.page === 'series-books')) { + this.$router.replace('/bookshelf') + return + } + if (this.hasFilter) { this.clearFilter() } else { diff --git a/pages/bookshelf/search.vue b/pages/bookshelf/search.vue index d218cb4d..20d6ad77 100644 --- a/pages/bookshelf/search.vue +++ b/pages/bookshelf/search.vue @@ -131,9 +131,20 @@ export default { this.selectedPodcast = podcast this.showSelectedFeed = true console.log('Got podcast feed', payload.podcast) + }, + libraryChanged() { + const libraryMediaType = this.$store.getters['libraries/getCurrentLibraryMediaType'] + if (libraryMediaType !== 'podcast') { + this.$router.replace('/bookshelf') + } } }, - mounted() {} + mounted() { + this.$eventBus.$on('library-changed', this.libraryChanged) + }, + beforeDestroy() { + this.$eventBus.$off('library-changed', this.libraryChanged) + } }