[web] Fix count of albums and tracks in genre pages

This commit is contained in:
Alain Nussbaumer 2024-03-31 21:22:45 +02:00
parent 2451ac608f
commit cbedb4d38c
5 changed files with 14 additions and 8 deletions

View File

@ -33,7 +33,7 @@ const dataObject = {
},
set(vm, response) {
vm.genres = new GroupedList(response.data, {
vm.genres = new GroupedList(response.data.genres, {
index: { field: 'name_sort', type: String }
})
}

View File

@ -62,7 +62,7 @@ const dataObject = {
},
set(vm, response) {
vm.genre = response[0].data
vm.genre = response[0].data.genres.items[0]
vm.albums = new GroupedList(response[1].data.albums, {
index: { field: 'name_sort', type: String }
})

View File

@ -73,7 +73,7 @@ const dataObject = {
},
set(vm, response) {
vm.genre = response[0].data
vm.genre = response[0].data.genres.items[0]
vm.tracks_list = new GroupedList(response[1].data.tracks)
}
}

View File

@ -33,7 +33,7 @@ const dataObject = {
},
set(vm, response) {
vm.genres = new GroupedList(response.data, {
vm.genres = new GroupedList(response.data.genres, {
index: { field: 'name_sort', type: String }
})
}

View File

@ -115,9 +115,11 @@ export default {
},
library_genre(genre, media_kind) {
return axios.get(`./api/library/genres/${encodeURIComponent(genre)}`, {
params: { media_kind }
})
const params = {
expression: `genre is "${genre}" and media_kind is ${media_kind}`,
type: 'genres'
}
return axios.get('./api/search', { params })
},
library_genre_albums(genre, media_kind) {
@ -137,7 +139,11 @@ export default {
},
library_genres(media_kind) {
return axios.get('./api/library/genres', { params: { media_kind } })
const params = {
expression: `media_kind is ${media_kind}`,
type: 'genres'
}
return axios.get('./api/search', { params })
},
library_playlist(playlistId) {