[vlc-commits] [Git][videolan/vlc][master] 4 commits: qml: hide header in MediaView when model is empty

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun May 25 12:29:04 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
a4ac52a2 by Ashutosh Verma at 2025-05-25T12:13:23+00:00
qml: hide header in MediaView when model is empty

Signed-off by: Ash <ashutoshv191 at gmail.com>

- - - - -
02b79559 by Ashutosh Verma at 2025-05-25T12:13:23+00:00
medialibrary: make medialibrary history apis searchable

Add search capability in history list and count
in the medialibrary apis.

Signed-off by: Ash <ashutoshv191 at gmail.com>

- - - - -
4d3a89a8 by Ashutosh Verma at 2025-05-25T12:13:23+00:00
qml: add search capability in the Continue Watching row

Signed-off by: Ash <ashutoshv191 at gmail.com>

- - - - -
2be21d80 by Ashutosh Verma at 2025-05-25T12:13:23+00:00
qml: add search capability in the Continue Watching sub-view

Signed-off by: Ash <ashutoshv191 at gmail.com>

- - - - -


4 changed files:

- modules/gui/qt/medialibrary/qml/HomeDisplay.qml
- modules/gui/qt/medialibrary/qml/HomePage.qml
- modules/gui/qt/medialibrary/qml/MediaView.qml
- modules/misc/medialibrary/medialibrary.cpp


Changes:

=====================================
modules/gui/qt/medialibrary/qml/HomeDisplay.qml
=====================================
@@ -72,6 +72,7 @@ Widgets.PageLoader {
 
                 sortCriteria: MainCtx.sort.criteria
                 sortOrder: MainCtx.sort.order
+                searchPattern: MainCtx.search.pattern
             }
 
             header: Widgets.ViewHeader {
@@ -80,8 +81,6 @@ Widgets.PageLoader {
                 text: qsTr("Continue Watching")
             }
 
-            isSearchable: false // TODO: make history searchable
-
             sectionProperty: model.sortCriteria === "title" ? "title_first_symbol" : ""
 
             contextMenu: MLContextMenu {


=====================================
modules/gui/qt/medialibrary/qml/HomePage.qml
=====================================
@@ -40,7 +40,7 @@ T.Page {
 
     readonly property bool hasGridListMode: true
 
-    readonly property bool isSearchable: false // TODO: make history searchable
+    readonly property bool isSearchable: true
 
     readonly property ColorContext colorContext: ColorContext {
         id: theme
@@ -249,6 +249,7 @@ T.Page {
 
                     sortCriteria: MainCtx.sort.criteria
                     sortOrder: MainCtx.sort.order
+                    searchPattern: MainCtx.search.pattern
 
                     // FIXME: Make limit 0 load no items, instead of loading all items.
                     limit: MainCtx.gridView ? Math.max(continueWatchingRow.currentItem?.nbItemPerRow ?? null, 1) : 5
@@ -272,8 +273,6 @@ T.Page {
                     }
                 }
 
-                isSearchable: false // TODO: make history searchable
-
                 contextMenu: MLContextMenu {
                     model: continueWatchingRow.model
 


=====================================
modules/gui/qt/medialibrary/qml/MediaView.qml
=====================================
@@ -123,6 +123,8 @@ MainViewLoader {
         Widgets.ViewHeader {
             view: root
 
+            visible: view.count > 0
+
             text: root.headerText
 
             seeAllButton.visible: root.seeAllButtonVisible


=====================================
modules/misc/medialibrary/medialibrary.cpp
=====================================
@@ -1182,17 +1182,27 @@ int MediaLibrary::List( int listQuery, const vlc_ml_query_params_t* params, va_l
             case VLC_ML_COUNT_HISTORY:
             case VLC_ML_LIST_HISTORY:
             {
-                const auto type = static_cast<medialibrary::HistoryType>( va_arg(args, int) );
-                query = m_ml->history( type, paramsPtr );
+                const auto hisType = static_cast<medialibrary::HistoryType>( va_arg(args, int) );
+
+                if ( psz_pattern != nullptr )
+                    query = m_ml->searchInHistory( hisType, psz_pattern, paramsPtr );
+                else
+                    query = m_ml->history( hisType, paramsPtr );
                 break;
             }
             case VLC_ML_COUNT_VIDEO_HISTORY:
             case VLC_ML_LIST_VIDEO_HISTORY:
-                query = m_ml->videoHistory( paramsPtr );
+                if ( psz_pattern != nullptr )
+                    query = m_ml->searchInVideoHistory( psz_pattern, paramsPtr );
+                else
+                    query = m_ml->videoHistory( paramsPtr );
                 break;
             case VLC_ML_COUNT_AUDIO_HISTORY:
             case VLC_ML_LIST_AUDIO_HISTORY:
-                query = m_ml->audioHistory( paramsPtr );
+                if ( psz_pattern != nullptr )
+                    query = m_ml->searchInAudioHistory( psz_pattern, paramsPtr );
+                else
+                    query = m_ml->audioHistory( paramsPtr );
                 break;
             default:
                 vlc_assert_unreachable();



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/88e3c3344a7dbe579efb1c4b5f4ef4452b6b63fc...2be21d808c631696b2a06d8eddd24226de90fef3

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/88e3c3344a7dbe579efb1c4b5f4ef4452b6b63fc...2be21d808c631696b2a06d8eddd24226de90fef3
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