[gnome-software/wip/hughsie/speedup-category-apps: 2/2] Create a wildcard result when getting category apps



commit c2d17a6fff2514036df6ac23e8dbd4743444d3c5
Author: Richard Hughes <richard hughsie com>
Date:   Mon Jul 15 13:41:11 2019 +0100

    Create a wildcard result when getting category apps
    
    This allows us to always return the 'best' application for the popular and
    picks subsections, and also means we only refine the GsApp once which is 2x
    faster when there are a lot of results.

 plugins/core/gs-appstream.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index ec6ade61..2999ab44 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -1170,11 +1170,11 @@ gs_appstream_add_category_apps (GsPlugin *plugin,
                for (guint i = 0; i < components->len; i++) {
                        XbNode *component = g_ptr_array_index (components, i);
                        g_autoptr(GsApp) app = NULL;
-
-                       /* add all the data we can */
-                       app = gs_appstream_create_app (plugin, silo, component, error);
-                       if (app == NULL)
-                               return FALSE;
+                       const gchar *id = xb_node_query_text (component, "id", NULL);
+                       if (id == NULL)
+                               continue;
+                       app = gs_app_new (id);
+                       gs_app_add_quirk (app, GS_APP_QUIRK_IS_WILDCARD);
                        gs_app_list_add (list, app);
                }
 


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