Add remaining personalized shelf queries, update book libraries home page to use new API endpoint

This commit is contained in:
advplyr 2023-08-05 14:01:16 -05:00
parent 80b3bfea51
commit 09eefae808
20 changed files with 359 additions and 26 deletions

View file

@ -68,6 +68,9 @@ export default {
currentLibraryId() {
return this.$store.state.libraries.currentLibraryId
},
currentLibraryMediaType() {
return this.$store.getters['libraries/getCurrentLibraryMediaType']
},
libraryName() {
return this.$store.getters['libraries/getCurrentLibraryName']
},
@ -167,8 +170,9 @@ export default {
this.loaded = true
},
async fetchCategories() {
const endpoint = this.currentLibraryMediaType === 'book' ? 'personalized2' : 'personalized'
const categories = await this.$axios
.$get(`/api/libraries/${this.currentLibraryId}/personalized?include=rssfeed,numEpisodesIncomplete`)
.$get(`/api/libraries/${this.currentLibraryId}/${endpoint}?include=rssfeed,numEpisodesIncomplete`)
.then((data) => {
return data
})
@ -346,8 +350,6 @@ export default {
})
},
episodeAdded(episodeWithLibraryItem) {
console.log('Podcast episode added', episodeWithLibraryItem)
const isThisLibrary = episodeWithLibraryItem.libraryItem?.libraryId === this.currentLibraryId
if (!this.search && isThisLibrary) {
this.fetchCategories()

View file

@ -348,6 +348,10 @@ export default {
},
tracks() {
return [
{
id: 'none',
name: this.$strings.LabelTracksNone
},
{
id: 'single',
name: this.$strings.LabelTracksSingleTrack