From a4a112e081b300104b1080eaceb7f8e1bf666a6e Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Mon, 8 Apr 2019 11:43:04 +0200
Subject: [PATCH] Fix#795: cover not showing in queue/player when playing
 tracks from "albums" tab

---
 changes/changelog.d/795.bugfix            |  1 +
 front/src/components/audio/album/Card.vue | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 changes/changelog.d/795.bugfix

diff --git a/changes/changelog.d/795.bugfix b/changes/changelog.d/795.bugfix
new file mode 100644
index 0000000000..13191c0f12
--- /dev/null
+++ b/changes/changelog.d/795.bugfix
@@ -0,0 +1 @@
+Fixed cover not showing in queue/player when playing tracks from "albums" tab (#795)
diff --git a/front/src/components/audio/album/Card.vue b/front/src/components/audio/album/Card.vue
index 54ae9f254c..bdc0dd6cb5 100644
--- a/front/src/components/audio/album/Card.vue
+++ b/front/src/components/audio/album/Card.vue
@@ -45,7 +45,7 @@
         </div>
       </div>
       <div class="extra content">
-        <play-button class="mini basic orange right floated" :tracks="album.tracks" :album="album">
+        <play-button class="mini basic orange right floated" :tracks="tracksWithAlbum" :album="album">
           <translate translate-context="Content/Queue/Button.Label/Short, Verb">Play all</translate>
         </play-button>
         <span>
@@ -83,6 +83,20 @@ export default {
         return this.album.tracks
       }
       return this.album.tracks.slice(0, this.initialTracks)
+    },
+    tracksWithAlbum () {
+      // needed to include album data (especially cover)
+      // with tracks appended in queue (#795)
+      let self = this
+      return this.album.tracks.map(t => {
+        return  {
+          ...t,
+          album: {
+            ...self.album,
+            tracks: []
+          }
+        }
+      })
     }
   }
 }
-- 
GitLab