diff --git a/web-src/src/components/ListAlbums.vue b/web-src/src/components/ListAlbums.vue new file mode 100644 index 00000000..4e2f59e7 --- /dev/null +++ b/web-src/src/components/ListAlbums.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/web-src/src/components/ListArtists.vue b/web-src/src/components/ListArtists.vue new file mode 100644 index 00000000..ca32bdcd --- /dev/null +++ b/web-src/src/components/ListArtists.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/web-src/src/components/ModalDialogAlbum.vue b/web-src/src/components/ModalDialogAlbum.vue index 6b8e621a..1700bb3b 100644 --- a/web-src/src/components/ModalDialogAlbum.vue +++ b/web-src/src/components/ModalDialogAlbum.vue @@ -14,19 +14,15 @@

{{ album.name }}

-
+
Mark as played Remove podcast
-

+

Album artist {{ album.artist }}

-

- Album artist - {{ album.artist }} -

Release date {{ album.date_released | time('L') }} @@ -90,6 +86,10 @@ export default { computed: { artwork_url: function () { return webapi.artwork_url_append_size_params(this.album.artwork_url) + }, + + media_kind_resolved: function () { + return this.media_kind ? this.media_kind : this.album.media_kind } }, @@ -110,9 +110,9 @@ export default { }, open_album: function () { - if (this.media_kind === 'podcast') { + if (this.media_kind_resolved === 'podcast') { this.$router.push({ path: '/podcasts/' + this.album.id }) - } else if (this.media_kind === 'audiobook') { + } else if (this.media_kind_resolved === 'audiobook') { this.$router.push({ path: '/audiobooks/' + this.album.id }) } else { this.$router.push({ path: '/music/albums/' + this.album.id }) @@ -120,7 +120,13 @@ export default { }, open_artist: function () { - this.$router.push({ path: '/music/artists/' + this.album.artist_id }) + if (this.media_kind_resolved === 'podcast') { + // No artist page for podcasts + } else if (this.media_kind_resolved === 'audiobook') { + this.$router.push({ path: '/audiobooks/artists/' + this.album.artist_id }) + } else { + this.$router.push({ path: '/music/artists/' + this.album.artist_id }) + } }, mark_played: function () { diff --git a/web-src/src/pages/PageAlbums.vue b/web-src/src/pages/PageAlbums.vue index 339f37a5..e887dda4 100644 --- a/web-src/src/pages/PageAlbums.vue +++ b/web-src/src/pages/PageAlbums.vue @@ -19,27 +19,7 @@

@@ -50,9 +30,7 @@ import { LoadDataBeforeEnterMixin } from './mixin' import ContentWithHeading from '@/templates/ContentWithHeading' import TabsMusic from '@/components/TabsMusic' import IndexButtonList from '@/components/IndexButtonList' -import ListItemAlbum from '@/components/ListItemAlbum' -import ModalDialogAlbum from '@/components/ModalDialogAlbum' -import CoverArtwork from '@/components/CoverArtwork' +import ListAlbums from '@/components/ListAlbums' import webapi from '@/webapi' import * as types from '@/store/mutation_types' @@ -72,15 +50,12 @@ const albumsData = { export default { name: 'PageAlbums', mixins: [LoadDataBeforeEnterMixin(albumsData)], - components: { ContentWithHeading, TabsMusic, IndexButtonList, ListItemAlbum, ModalDialogAlbum, CoverArtwork }, + components: { ContentWithHeading, TabsMusic, IndexButtonList, ListAlbums }, data () { return { albums: { items: [] }, - index_list: [], - - show_details_modal: false, - selected_album: {} + index_list: [] } }, @@ -91,25 +66,12 @@ export default { albums_filtered () { return this.albums.items.filter(album => !this.hide_singles || album.track_count > 2) - }, - - is_visible_artwork () { - return this.$store.getters.settings_option('webinterface', 'show_cover_artwork_in_album_lists').value } }, methods: { update_hide_singles: function (e) { this.$store.commit(types.HIDE_SINGLES, !this.hide_singles) - }, - - open_album: function (album) { - this.$router.push({ path: '/music/albums/' + album.id }) - }, - - open_dialog: function (album) { - this.selected_album = album - this.show_details_modal = true } }, diff --git a/web-src/src/pages/PageArtist.vue b/web-src/src/pages/PageArtist.vue index 5e240931..8056fce7 100644 --- a/web-src/src/pages/PageArtist.vue +++ b/web-src/src/pages/PageArtist.vue @@ -15,24 +15,7 @@ @@ -41,10 +24,8 @@ diff --git a/web-src/src/pages/PageAudiobooksArtist.vue b/web-src/src/pages/PageAudiobooksArtist.vue new file mode 100644 index 00000000..fdbd98f7 --- /dev/null +++ b/web-src/src/pages/PageAudiobooksArtist.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/web-src/src/pages/PageAudiobooksArtists.vue b/web-src/src/pages/PageAudiobooksArtists.vue index ba3d3f0f..3d94cc6a 100644 --- a/web-src/src/pages/PageAudiobooksArtists.vue +++ b/web-src/src/pages/PageAudiobooksArtists.vue @@ -13,17 +13,7 @@
@@ -34,10 +24,8 @@ import { LoadDataBeforeEnterMixin } from './mixin' import ContentWithHeading from '@/templates/ContentWithHeading' import TabsAudiobooks from '@/components/TabsAudiobooks' import IndexButtonList from '@/components/IndexButtonList' -import ListItemArtist from '@/components/ListItemArtist' -import ModalDialogArtist from '@/components/ModalDialogArtist' +import ListArtists from '@/components/ListArtists' import webapi from '@/webapi' -import * as types from '@/store/mutation_types' const artistsData = { load: function (to) { @@ -52,46 +40,23 @@ const artistsData = { export default { name: 'PageAudiobooksArtists', mixins: [LoadDataBeforeEnterMixin(artistsData)], - components: { ContentWithHeading, TabsAudiobooks, IndexButtonList, ListItemArtist, ModalDialogArtist }, + components: { ContentWithHeading, TabsAudiobooks, IndexButtonList, ListArtists }, data () { return { - artists: { items: [] }, - - show_details_modal: false, - selected_artist: {} + artists: { items: [] } } }, computed: { - hide_singles () { - return this.$store.state.hide_singles - }, - index_list () { return [...new Set(this.artists.items .filter(artist => !this.$store.state.hide_singles || artist.track_count > (artist.album_count * 2)) .map(artist => artist.name_sort.charAt(0).toUpperCase()))] - }, - - artists_filtered () { - return this.artists.items.filter(artist => !this.hide_singles || artist.track_count > (artist.album_count * 2)) } }, methods: { - update_hide_singles: function (e) { - this.$store.commit(types.HIDE_SINGLES, !this.hide_singles) - }, - - open_artist: function (artist) { - this.$router.push({ path: '/music/artists/' + artist.id }) - }, - - open_dialog: function (artist) { - this.selected_artist = artist - this.show_details_modal = true - } } } diff --git a/web-src/src/router/index.js b/web-src/src/router/index.js index 491ab6e6..9edf9c3d 100644 --- a/web-src/src/router/index.js +++ b/web-src/src/router/index.js @@ -19,6 +19,7 @@ import PagePodcasts from '@/pages/PagePodcasts' import PagePodcast from '@/pages/PagePodcast' import PageAudiobooks from '@/pages/PageAudiobooks' import PageAudiobooksArtists from '@/pages/PageAudiobooksArtists' +import PageAudiobooksArtist from '@/pages/PageAudiobooksArtist' import PageAudiobook from '@/pages/PageAudiobook' import PagePlaylists from '@/pages/PagePlaylists' import PagePlaylist from '@/pages/PagePlaylist' @@ -149,6 +150,12 @@ export const router = new VueRouter({ component: PageAudiobooksArtists, meta: { show_progress: true, has_tabs: true, has_index: true } }, + { + path: '/audiobooks/artists/:artist_id', + name: 'AudiobooksArtist', + component: PageAudiobooksArtist, + meta: { show_progress: true } + }, { path: '/audiobooks/albums', name: 'AudiobooksAlbums',