[gnome-software/1630-new-updated-apps-are-not-actually-new: 5/9] gs-plugin-loader: Do preliminary filtering when getting recent apps




commit 5e93387c532db18403d3fec369627fd2aeb071f7
Author: Milan Crha <mcrha redhat com>
Date:   Fri Feb 25 12:19:35 2022 +0100

    gs-plugin-loader: Do preliminary filtering when getting recent apps
    
    The list can contain duplicates and other non-applicable apps,
    which can be recognized also without a full app refine. This way
    the list is truncated with a better set, where are the most apps
    relevant for the result.

 lib/gs-plugin-loader.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index b40c99ff2..d50ba52dc 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -3229,6 +3229,13 @@ gs_plugin_loader_process_thread_cb (GTask *task,
                }
        }
 
+       if (action == GS_PLUGIN_ACTION_GET_RECENT) {
+               /* Preliminary filter recent apps, to have truncated a meaningful list */
+               gs_app_list_filter_duplicates (list, GS_APP_LIST_FILTER_FLAG_KEY_ID);
+               gs_app_list_filter (list, gs_plugin_loader_app_is_non_compulsory, NULL);
+               gs_app_list_filter (list, gs_plugin_loader_app_is_desktop, NULL);
+       }
+
        /* filter to reduce to a sane set */
        gs_plugin_loader_job_sorted_truncation (helper);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]