diff --git a/web-src/src/pages/PageAlbums.vue b/web-src/src/pages/PageAlbums.vue index 8e3e4cae..1230b001 100644 --- a/web-src/src/pages/PageAlbums.vue +++ b/web-src/src/pages/PageAlbums.vue @@ -47,7 +47,7 @@ import * as types from '@/store/mutation_types' const albumsData = { load: function (to) { - return webapi.library_albums() + return webapi.library_albums('music') }, set: function (vm, response) { diff --git a/web-src/src/pages/PageArtist.vue b/web-src/src/pages/PageArtist.vue index 50ec0958..2f26e033 100644 --- a/web-src/src/pages/PageArtist.vue +++ b/web-src/src/pages/PageArtist.vue @@ -40,7 +40,7 @@ const artistData = { load: function (to) { return Promise.all([ webapi.library_artist(to.params.artist_id), - webapi.library_albums(to.params.artist_id) + webapi.library_artist_albums(to.params.artist_id) ]) }, diff --git a/web-src/src/pages/PageAudiobooks.vue b/web-src/src/pages/PageAudiobooks.vue index 203693e7..00104694 100644 --- a/web-src/src/pages/PageAudiobooks.vue +++ b/web-src/src/pages/PageAudiobooks.vue @@ -28,7 +28,7 @@ import webapi from '@/webapi' const albumsData = { load: function (to) { - return webapi.library_audiobooks() + return webapi.library_albums('audiobook') }, set: function (vm, response) { diff --git a/web-src/src/pages/PageAudiobooksArtists.vue b/web-src/src/pages/PageAudiobooksArtists.vue new file mode 100644 index 00000000..7b93746f --- /dev/null +++ b/web-src/src/pages/PageAudiobooksArtists.vue @@ -0,0 +1,106 @@ + + + + + + + + + + Artists + {{ artists.total }} artists + + + + + + + Hide singles + + + + + + + + + + + + + + + + + + + diff --git a/web-src/src/pages/PagePodcasts.vue b/web-src/src/pages/PagePodcasts.vue index f657cfa1..48a39ba5 100644 --- a/web-src/src/pages/PagePodcasts.vue +++ b/web-src/src/pages/PagePodcasts.vue @@ -101,7 +101,7 @@ import webapi from '@/webapi' const albumsData = { load: function (to) { return Promise.all([ - webapi.library_podcasts(), + webapi.library_albums('podcast'), webapi.library_podcasts_new_episodes() ]) }, @@ -195,7 +195,7 @@ export default { }, reload_podcasts: function () { - webapi.library_podcasts().then(({ data }) => { + webapi.library_albums('podcast').then(({ data }) => { this.albums = data this.reload_new_episodes() }) diff --git a/web-src/src/webapi/index.js b/web-src/src/webapi/index.js index 0d45ca6d..1960be74 100644 --- a/web-src/src/webapi/index.js +++ b/web-src/src/webapi/index.js @@ -208,11 +208,12 @@ export default { return axios.get('/api/library/artists/' + artistId) }, - library_albums (artistId) { - if (artistId) { - return axios.get('/api/library/artists/' + artistId + '/albums') - } - return axios.get('/api/library/albums?media_kind=music') + library_artist_albums (artistId) { + return axios.get('/api/library/artists/' + artistId + '/albums') + }, + + library_albums (media_kind = undefined) { + return axios.get('/api/library/albums', { params: { media_kind: media_kind } }) }, library_album (albumId) { @@ -278,10 +279,6 @@ export default { } }, - library_podcasts () { - return axios.get('/api/library/albums?media_kind=podcast') - }, - library_podcasts_new_episodes () { var episodesParams = { type: 'tracks', @@ -310,10 +307,6 @@ export default { return axios.delete('/api/library/playlists/' + playlistId, undefined) }, - library_audiobooks () { - return axios.get('/api/library/albums?media_kind=audiobook') - }, - library_playlists () { return axios.get('/api/library/playlists') },
Artists
{{ artists.total }} artists