playlistwithmetadata: default to filename with no title mediadata 17/8717/2
authorMatt Ranostay <matt.ranostay@konsulko.com>
Fri, 10 Mar 2017 19:49:11 +0000 (11:49 -0800)
committerMatt Ranostay <matt.ranostay@konsulko.com>
Sun, 12 Mar 2017 01:08:56 +0000 (17:08 -0800)
Some multimedia files do not have title metadata so default to
the short filename of the media.

Change-Id: I45949085c038eddb648e483942fd7aa21b64eae4
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
app/playlistwithmetadata.cpp

index be6d9a1..28bd0b2 100644 (file)
@@ -160,6 +160,8 @@ QVariant PlaylistWithMetadata::data(const QModelIndex &index, int role) const
     switch (role) {
     case TitleRole:
         ret = d->title.value(url);
+        if (ret.toString().isEmpty())
+            ret = QVariant(url.fileName());
         break;
     case ArtistRole:
         ret = d->artist.value(url);