diff --git a/web-src/src/components/ModalDialogAlbum.vue b/web-src/src/components/ModalDialogAlbum.vue index fe7bd498..4ffd58f1 100644 --- a/web-src/src/components/ModalDialogAlbum.vue +++ b/web-src/src/components/ModalDialogAlbum.vue @@ -12,6 +12,9 @@

{{ album.name }}

+
+ Mark as played +

Album artist @@ -51,7 +54,7 @@ import webapi from '@/webapi' export default { name: 'ModalDialogAlbum', - props: ['show', 'album', 'media_kind'], + props: ['show', 'album', 'media_kind', 'new_tracks'], data () { return { @@ -95,6 +98,13 @@ export default { this.$router.push({ path: '/music/artists/' + this.album.artist_id }) }, + mark_played: function () { + webapi.library_album_track_update(this.album.id, { play_count: 'played' }).then(({ data }) => { + this.$emit('play_count_changed') + this.$emit('close') + }) + }, + artwork_loaded: function () { this.artwork_visible = true }, diff --git a/web-src/src/pages/PagePodcast.vue b/web-src/src/pages/PagePodcast.vue index 7c61ba17..7a2654db 100644 --- a/web-src/src/pages/PagePodcast.vue +++ b/web-src/src/pages/PagePodcast.vue @@ -12,12 +12,6 @@ - - + + @@ -74,7 +78,6 @@ const albumData = { set: function (vm, response) { vm.album = response[0].data vm.tracks = response[1].data.tracks.items - vm.unplayed = !vm.tracks.every(track => track.play_count > 0) } } @@ -87,7 +90,6 @@ export default { return { album: {}, tracks: [], - unplayed: false, show_details_modal: false, selected_track: {}, @@ -96,6 +98,12 @@ export default { } }, + computed: { + new_tracks () { + return this.tracks.filter(track => track.play_count === 0).length + } + }, + methods: { play: function () { webapi.player_play_uri(this.album.uri, false) @@ -105,17 +113,6 @@ export default { webapi.player_play_uri(track.uri, false) }, - mark_all_played: function () { - webapi.library_album_track_update(this.album.id, { play_count: 'played' }).then(({ data }) => ( - this.tracks.forEach(track => { - if (track.play_count === 0) { - track.play_count = 1 - } - }) - )) - this.unplayed = false - }, - open_dialog: function (track) { this.selected_track = track this.show_details_modal = true