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.
This commit is contained in:
parent
3886f3d1e4
commit
a4be57414a
@ -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());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user