qt: playlist: use item title if available master
authorRomain Vimont <rom1v@videolabs.io>
Tue, 20 Apr 2021 15:26:28 +0000 (17:26 +0200)
committerPierre Lamot <pierre@videolabs.io>
Thu, 22 Apr 2021 09:04:24 +0000 (11:04 +0200)
Use the meta title if it is available, use the item name otherwise.

Fixes #25648

Signed-off-by: Pierre Lamot <pierre@videolabs.io>
modules/gui/qt/playlist/playlist_item.cpp

index 0d7d460..18ba080 100644 (file)
@@ -73,15 +73,20 @@ QUrl PlaylistItem::getUrl() const
 void PlaylistItem::sync() {
     input_item_t *media = vlc_playlist_item_GetMedia(d->item.get());
     vlc_mutex_lock(&media->lock);
-    d->title    = media->psz_name;
     d->duration = media->i_duration;
     d->url      = media->psz_uri;
 
     if (media->p_meta) {
+        d->title   = vlc_meta_Get(media->p_meta, vlc_meta_Title);
         d->artist  = vlc_meta_Get(media->p_meta, vlc_meta_Artist);
         d->album   = vlc_meta_Get(media->p_meta, vlc_meta_Album);
         d->artwork = vlc_meta_Get(media->p_meta, vlc_meta_ArtworkURL);
     }
+
+    if (d->title.isNull())
+        /* If there is no title, use the item name */
+        d->title = media->psz_name;
+
     vlc_mutex_unlock(&media->lock);
 }