From a4be57414a3532783d75f73b982f2c757ef657d6 Mon Sep 17 00:00:00 2001 From: Mark Furneaux Date: Mon, 22 Dec 2014 16:53:58 -0500 Subject: [PATCH] Don't load the moodbar if the song was stopped When an async moodbar load completes, it checks to see if the song is still playing and should update the UI. It however failed to check if the song was stopped, so it would load a moodbar when no song is playing. It now checks the player state before emitting a change. --- src/moodbar/moodbarcontroller.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/moodbar/moodbarcontroller.cpp b/src/moodbar/moodbarcontroller.cpp index 8cd0f5180..3f2887452 100644 --- a/src/moodbar/moodbarcontroller.cpp +++ b/src/moodbar/moodbarcontroller.cpp @@ -69,6 +69,17 @@ void MoodbarController::AsyncLoadComplete(MoodbarPipeline* pipeline, if (current_item && current_item->Url() != url) { return; } + // Did we stop the song? + switch(app_->player()->GetState()) { + case Engine::Error: + case Engine::Empty: + case Engine::Idle: + return; + break; + + default: + break; + } emit CurrentMoodbarDataChanged(pipeline->data()); }