From b724291ef9e6e1406d8229e32ff9b0ae2bc39bc9 Mon Sep 17 00:00:00 2001
From: Mattias Andersson <mandersson444@gmail.com>
Date: Thu, 14 Dec 2017 22:48:03 +0100
Subject: [PATCH] Ensure that the correct playlist is played (#5929)

When the playlist doubleclick behavior is set to add songs to the queue,
the playback of the queue also starts if no song is currently
playing. To play the queue from the current playlist, we must set the
active playlist to the current one before starting the playback.

Fixes #5714.
---
 src/ui/mainwindow.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp
index 2e2e9aba4..b921805af 100644
--- a/src/ui/mainwindow.cpp
+++ b/src/ui/mainwindow.cpp
@@ -1354,6 +1354,7 @@ void MainWindow::PlaylistDoubleClick(const QModelIndex& index) {
       app_->playlist_manager()->current()->queue()->ToggleTracks(
           dummyIndexList);
       if (app_->player()->GetState() != Engine::Playing) {
+        app_->playlist_manager()->SetActiveToCurrent();
         app_->player()->PlayAt(
             app_->playlist_manager()->current()->queue()->TakeNext(),
             Engine::Manual, true);