[vlc-commits] [Git][videolan/vlc][master] 6 commits: qml: Show 'Videos' instead of 'Tracks' on video playlists

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sat Mar 28 11:19:26 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
95a6ee26 by Leon Vitanos at 2026-03-28T12:06:17+01:00
qml: Show 'Videos' instead of 'Tracks' on video playlists

- - - - -
952fc888 by Leon Vitanos at 2026-03-28T12:06:17+01:00
qt/qml: show number of tracks and videos in a mixed playlist

- - - - -
39f02035 by Leon Vitanos at 2026-03-28T12:06:17+01:00
qml: remove #items label in ListView, rename 'Tracks' column to 'Items'

- - - - -
f8bbcce0 by Leon Vitanos at 2026-03-28T12:06:17+01:00
qml: show exact item counts instead of 99+

- - - - -
a845d9f6 by Leon Vitanos at 2026-03-28T12:06:17+01:00
qt/qml: show number of unknown type media as "Other"

- - - - -
9115e3e0 by Leon Vitanos at 2026-03-28T12:06:17+01:00
qml: align text of labels to the right in case of vertical stacking

- - - - -


6 changed files:

- modules/gui/qt/medialibrary/mlplaylist.cpp
- modules/gui/qt/medialibrary/mlplaylist.hpp
- modules/gui/qt/medialibrary/mlplaylistlistmodel.cpp
- modules/gui/qt/medialibrary/mlplaylistlistmodel.hpp
- modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml
- modules/gui/qt/widgets/qml/VideoQualityLabels.qml


Changes:

=====================================
modules/gui/qt/medialibrary/mlplaylist.cpp
=====================================
@@ -31,6 +31,9 @@ MLPlaylist::MLPlaylist(const vlc_ml_playlist_t * data)
     , m_name(qfu(data->psz_name))
     , m_duration(data->i_duration)
     , m_count(data->i_nb_media)
+    , m_nbAudio(data->i_nb_audio)
+    , m_nbVideo(data->i_nb_video)
+    , m_nbUnknown(data->i_nb_unknown)
 {
     assert(data);
 }
@@ -60,3 +63,18 @@ unsigned int MLPlaylist::getCount() const
 {
     return m_count;
 }
+
+unsigned int MLPlaylist::getNbAudio() const
+{
+    return m_nbAudio;
+}
+
+unsigned int MLPlaylist::getNbVideo() const
+{
+    return m_nbVideo;
+}
+
+unsigned int MLPlaylist::getNbUnknown() const
+{
+    return m_nbUnknown;
+}


=====================================
modules/gui/qt/medialibrary/mlplaylist.hpp
=====================================
@@ -40,6 +40,9 @@ public: // Interface
     VLCDuration getDuration() const;
 
     unsigned int getCount() const;
+    unsigned int getNbAudio() const;
+    unsigned int getNbVideo() const;
+    unsigned int getNbUnknown() const;
 
 private:
     QString m_name;
@@ -47,6 +50,9 @@ private:
     int64_t m_duration;
 
     unsigned int m_count;
+    unsigned int m_nbAudio;
+    unsigned int m_nbVideo;
+    unsigned int m_nbUnknown;
 };
 
 #endif


=====================================
modules/gui/qt/medialibrary/mlplaylistlistmodel.cpp
=====================================
@@ -272,7 +272,10 @@ QHash<int, QByteArray> MLPlaylistListModel::roleNames() const /* override */
         { PLAYLIST_NAME,      "name"      },
         { PLAYLIST_THUMBNAIL, "thumbnail" },
         { PLAYLIST_DURATION,  "duration"  },
-        { PLAYLIST_COUNT,     "count"     }
+        { PLAYLIST_COUNT,     "count"     },
+        { PLAYLIST_NB_AUDIO,  "nb_audio"  },
+        { PLAYLIST_NB_VIDEO,  "nb_video"  },
+        { PLAYLIST_NB_UNKNOWN,"nb_unknown"}
     };
 }
 
@@ -298,6 +301,12 @@ QVariant MLPlaylistListModel::itemRoleData(const MLItem *item, int role) const /
             return QVariant::fromValue(playlist->getDuration());
         case PLAYLIST_COUNT:
             return QVariant::fromValue(playlist->getCount());
+        case PLAYLIST_NB_AUDIO:
+            return QVariant::fromValue(playlist->getNbAudio());
+        case PLAYLIST_NB_VIDEO:
+            return QVariant::fromValue(playlist->getNbVideo());
+        case PLAYLIST_NB_UNKNOWN:
+            return QVariant::fromValue(playlist->getNbUnknown());
         default:
             return QVariant();
     }


=====================================
modules/gui/qt/medialibrary/mlplaylistlistmodel.hpp
=====================================
@@ -37,7 +37,10 @@ public:
         PLAYLIST_NAME,
         PLAYLIST_THUMBNAIL,
         PLAYLIST_DURATION,
-        PLAYLIST_COUNT
+        PLAYLIST_COUNT,
+        PLAYLIST_NB_AUDIO,
+        PLAYLIST_NB_VIDEO,
+        PLAYLIST_NB_UNKNOWN
     };
     Q_ENUM(Roles)
 


=====================================
modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml
=====================================
@@ -143,15 +143,6 @@ MainViewLoader {
         }
     }
 
-    function _getCount(model) {
-        const count = model.count;
-
-        if (count < 100)
-            return count;
-        else
-            return qsTr("99+");
-    }
-
     function _adjustDragAccepted(drag) {
         if (!root.model || root.model.transactionPending)
         {
@@ -327,7 +318,19 @@ MainViewLoader {
                 title: (model.name) ? model.name
                                     : qsTr("Unknown title")
 
-                labels: [ qsTr("%1 Track", "%1 Tracks", _getCount(model)).arg(_getCount(model)) ]
+                labels: [
+                    (function () {
+                        const labels = []
+                        if (model.nb_audio > 0)
+                            labels.push(qsTr("%1 Track", "%1 Tracks", model.nb_audio).arg(model.nb_audio))
+                        if (model.nb_video > 0)
+                            labels.push(qsTr("%1 Video", "%1 Videos", model.nb_video).arg(model.nb_video))
+                        if (model.nb_unknown > 0)
+                            labels.push(qsTr("%1 Other", "%1 Other", model.nb_unknown).arg(model.nb_unknown))
+
+                        return labels.join("\n")
+                    })()
+                ]
 
                 dragItem: dragItemPlaylist
 
@@ -435,7 +438,7 @@ MainViewLoader {
                 model: {
                     criteria: "count",
 
-                    text: qsTr("Tracks"),
+                    text: qsTr("Items"),
 
                     isSortable: false
                 }
@@ -515,7 +518,7 @@ MainViewLoader {
 
                 // NOTE: This makes sure we display the playlist count on the item.
                 function titlecoverLabels(model) {
-                    return [ _getCount(model) ];
+                    return [];
                 }
             }
         }


=====================================
modules/gui/qt/widgets/qml/VideoQualityLabels.qml
=====================================
@@ -52,6 +52,8 @@ Row {
 
             font.pixelSize: VLCStyle.fontSize_normal
 
+            horizontalAlignment: Text.AlignRight
+
             color: theme.fg.primary
 
             background: Rectangle {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3d6d9dca3a663b7f3c68f1fc02f47527cce5d2ef...9115e3e0da1e2353315333982b8ac4a9b061257e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3d6d9dca3a663b7f3c68f1fc02f47527cce5d2ef...9115e3e0da1e2353315333982b8ac4a9b061257e
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list