From 5d3fa4e087fe754404cd77cab2fbf51254251a12 Mon Sep 17 00:00:00 2001 From: Alain Nussbaumer Date: Sat, 9 Dec 2023 22:00:03 +0100 Subject: [PATCH] [web] Fix modal dialog for tracks --- web-src/src/components/ModalDialogTrack.vue | 163 +++++++++----------- 1 file changed, 76 insertions(+), 87 deletions(-) diff --git a/web-src/src/components/ModalDialogTrack.vue b/web-src/src/components/ModalDialogTrack.vue index a8bab9d8..3ba2e341 100644 --- a/web-src/src/components/ModalDialogTrack.vue +++ b/web-src/src/components/ModalDialogTrack.vue @@ -23,7 +23,7 @@ />
-

+

@@ -58,7 +58,7 @@ v-text="$filters.date(track.date_released)" />

-

+

@@ -70,14 +70,14 @@ v-text="track.genre" />

-

+

-

+

- - (, - ) -

-

+

@@ -175,7 +162,7 @@ - + @@ -225,73 +212,6 @@ export default { }, methods: { - play_track() { - this.$emit('close') - webapi.player_play_uri(this.track.uri, false) - }, - - queue_add() { - this.$emit('close') - webapi.queue_add(this.track.uri) - }, - - queue_add_next() { - this.$emit('close') - webapi.queue_add_next(this.track.uri) - }, - - open_album() { - this.$emit('close') - if (this.track.media_kind === 'podcast') { - this.$router.push({ - name: 'podcast', - params: { id: this.track.album_id } - }) - } else if (this.track.media_kind === 'audiobook') { - this.$router.push({ - name: 'audiobooks-album', - params: { id: this.track.album_id } - }) - } else { - this.$router.push({ - name: 'music-album', - params: { id: this.track.album_id } - }) - } - }, - - open_artist() { - this.$emit('close') - this.$router.push({ - name: 'music-artist', - params: { id: this.track.album_artist_id } - }) - }, - - open_genre() { - this.$router.push({ - name: 'genre-albums', - params: { name: this.track.genre }, - query: { media_kind: this.track.media_kind } - }) - }, - - open_spotify_artist() { - this.$emit('close') - this.$router.push({ - name: 'music-spotify-artist', - params: { id: this.spotify_track.artists[0].id } - }) - }, - - open_spotify_album() { - this.$emit('close') - this.$router.push({ - name: 'music-spotify-album', - params: { id: this.spotify_track.album.id } - }) - }, - mark_new() { webapi .library_track_update(this.track.id, { play_count: 'reset' }) @@ -308,6 +228,75 @@ export default { this.$emit('play-count-changed') this.$emit('close') }) + }, + + open_album() { + if (this.track.data_kind === 'spotify') { + this.$router.push({ + name: 'music-spotify-album', + params: { id: this.spotify_track.album.id } + }) + } else if (this.track.media_kind === 'podcast') { + this.$router.push({ + name: 'podcast', + params: { id: this.track.album_id } + }) + } else if (this.track.media_kind === 'audiobook') { + this.$router.push({ + name: 'audiobooks-album', + params: { id: this.track.album_id } + }) + } else if (this.track.media_kind === 'music') { + this.$router.push({ + name: 'music-album', + params: { id: this.track.album_id } + }) + } + }, + + open_album_artist() { + if (this.track.data_kind === 'spotify') { + this.$router.push({ + name: 'music-spotify-artist', + params: { id: this.spotify_track.artists[0].id } + }) + } else if ( + this.track.media_kind === 'music' || + this.track.media_kind === 'podcast' + ) { + this.$router.push({ + name: 'music-artist', + params: { id: this.track.album_artist_id } + }) + } else if (this.track.media_kind === 'audiobook') { + this.$router.push({ + name: 'audiobooks-artist', + params: { id: this.track.album_artist_id } + }) + } + }, + + open_genre() { + this.$router.push({ + name: 'genre-albums', + params: { name: this.track.genre }, + query: { media_kind: this.track.media_kind } + }) + }, + + play() { + this.$emit('close') + webapi.player_play_uri(this.track.uri, false) + }, + + queue_add() { + this.$emit('close') + webapi.queue_add(this.track.uri) + }, + + queue_add_next() { + this.$emit('close') + webapi.queue_add_next(this.track.uri) } } }