diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-09-12 21:49:16 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-09-12 23:33:21 -0700 |
commit | 5d2e0d0e22b9c66a20518c21481f55f0ba0f63c8 (patch) | |
tree | c5f5509ae0c58f601d9fa3ca3a5d99779f08ea4a | |
parent | 4221fd2f9e5b72090fe5c2c5f19aa16ab8bf68b8 (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.cpp | 16 |
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)); } |