From cbedb4d38ca7bf05646a5b17bd75deaf330ca769 Mon Sep 17 00:00:00 2001 From: Alain Nussbaumer Date: Sun, 31 Mar 2024 21:22:45 +0200 Subject: [PATCH] [web] Fix count of albums and tracks in genre pages --- web-src/src/pages/PageAudiobooksGenres.vue | 2 +- web-src/src/pages/PageGenreAlbums.vue | 2 +- web-src/src/pages/PageGenreTracks.vue | 2 +- web-src/src/pages/PageGenres.vue | 2 +- web-src/src/webapi/index.js | 14 ++++++++++---- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/web-src/src/pages/PageAudiobooksGenres.vue b/web-src/src/pages/PageAudiobooksGenres.vue index 95eeb69a..790efce3 100644 --- a/web-src/src/pages/PageAudiobooksGenres.vue +++ b/web-src/src/pages/PageAudiobooksGenres.vue @@ -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 } }) } diff --git a/web-src/src/pages/PageGenreAlbums.vue b/web-src/src/pages/PageGenreAlbums.vue index 5db4eeb9..851d2024 100644 --- a/web-src/src/pages/PageGenreAlbums.vue +++ b/web-src/src/pages/PageGenreAlbums.vue @@ -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 } }) diff --git a/web-src/src/pages/PageGenreTracks.vue b/web-src/src/pages/PageGenreTracks.vue index c0f48284..74f31862 100644 --- a/web-src/src/pages/PageGenreTracks.vue +++ b/web-src/src/pages/PageGenreTracks.vue @@ -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) } } diff --git a/web-src/src/pages/PageGenres.vue b/web-src/src/pages/PageGenres.vue index 3f12f09f..86845f26 100644 --- a/web-src/src/pages/PageGenres.vue +++ b/web-src/src/pages/PageGenres.vue @@ -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 } }) } diff --git a/web-src/src/webapi/index.js b/web-src/src/webapi/index.js index 8d366484..f0ce7bd5 100644 --- a/web-src/src/webapi/index.js +++ b/web-src/src/webapi/index.js @@ -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) {