summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-09-12 21:49:16 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2019-09-15 07:31:08 +0000
commitfc0369fdb69dcdcefeea80d3ddb580980e5365f4 (patch)
treed9a736e87a9e7f06b78f55b5cc6f8edaabfc1dfb
parent02daaf448c3ca6f63f851ae457e139be24372bc9 (diff)
mediaplayer: clear metadata in consumer UI on media removal
On storage removal the metadata displayed for the media playing should be cleared in consumer UI Bug-AGL: SPEC-1430 Change-Id: I9824c94cf81fc0beb0cc278ac980813e906efbe8 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--mediaplayer/mediaplayer.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/mediaplayer/mediaplayer.cpp b/mediaplayer/mediaplayer.cpp
index 0ef7d34..96799dc 100644
--- a/mediaplayer/mediaplayer.cpp
+++ b/mediaplayer/mediaplayer.cpp
@@ -62,6 +62,22 @@ void Mediaplayer::updatePlaylist(QVariantMap playlist)
m_playlist.append(new Playlist(item));
}
+ if (m_playlist.count() == 0) {
+ QVariantMap tmp, track;
+
+ track.insert("title", "");
+ track.insert("artist", "");
+ track.insert("album", "");
+ track.insert("duration", 0);
+
+ tmp.insert("position", 0);
+ tmp.insert("track", track);
+
+ // clear metadata in UI
+ m_context->setContextProperty("AlbumArt", "");
+ emit metadataChanged(tmp);
+ }
+
// Refresh model
m_context->setContextProperty("MediaplayerModel", QVariant::fromValue(m_playlist));
}