[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: copy audio and video count in MLFolderItem

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Fri Jun 10 13:31:40 UTC 2022



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


Commits:
f80bc370 by Pierre Lamot at 2022-06-09T14:30:28+02:00
qt: copy audio and video count in MLFolderItem

- - - - -
8dff08a9 by Pierre Lamot at 2022-06-09T14:30:36+02:00
qt: report the number of video media in MLVideoFolderModel

instead of the number of media

fix: #27054

- - - - -


3 changed files:

- modules/gui/qt/medialibrary/mlfolder.cpp
- modules/gui/qt/medialibrary/mlfolder.hpp
- modules/gui/qt/medialibrary/mlvideofoldersmodel.cpp


Changes:

=====================================
modules/gui/qt/medialibrary/mlfolder.cpp
=====================================
@@ -29,7 +29,10 @@ MLFolder::MLFolder(const vlc_ml_folder_t * data)
     , m_title(data->psz_name)
     , m_mrl(data->psz_mrl)
     , m_duration(0) // FIXME: We should have a duration field in vlc_ml_folder_t.
-    , m_count(data->i_nb_media) {}
+    , m_count(data->i_nb_media)
+    , m_audioCount(data->i_nb_audio)
+    , m_videoCount(data->i_nb_video)
+{}
 
 // Interface
 
@@ -62,3 +65,13 @@ unsigned int MLFolder::getCount() const
 {
     return m_count;
 }
+
+unsigned int MLFolder::getAudioCount() const
+{
+    return m_audioCount;
+}
+
+unsigned int MLFolder::getVideoCount() const
+{
+    return m_videoCount;
+}


=====================================
modules/gui/qt/medialibrary/mlfolder.hpp
=====================================
@@ -41,6 +41,10 @@ public: // Interface
 
     unsigned int getCount() const;
 
+    unsigned int getAudioCount() const;
+
+    unsigned int getVideoCount() const;
+
 private:
     bool m_present;
     bool m_banned;
@@ -52,6 +56,8 @@ private:
     int64_t m_duration;
 
     unsigned int m_count;
+    unsigned int m_audioCount;
+    unsigned int m_videoCount;
 };
 
 #endif


=====================================
modules/gui/qt/medialibrary/mlvideofoldersmodel.cpp
=====================================
@@ -95,7 +95,7 @@ QVariant MLVideoFoldersModel::itemRoleData(MLItem * item, const int role) const
         case FOLDER_DURATION:
             return QVariant::fromValue(folder->getDuration());
         case FOLDER_COUNT:
-            return QVariant::fromValue(folder->getCount());
+            return QVariant::fromValue(folder->getVideoCount());
         default:
             return QVariant();
     }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/452c0aeb778a46973de0244728b120845477734f...8dff08a97bb46584ea91d955f9cc838839981e6a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/452c0aeb778a46973de0244728b120845477734f...8dff08a97bb46584ea91d955f9cc838839981e6a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list