[gnome-software/1409-add-available-for-fedora-section-to-the-explore-page: 18/21] gs-plugin-appstream: Implement search for deployment-featured apps



commit 7e3230b87e1ebf4a92da816f8eafc63d208a2f7b
Author: Milan Crha <mcrha redhat com>
Date:   Fri May 6 12:02:29 2022 +0200

    gs-plugin-appstream: Implement search for deployment-featured apps

 plugins/core/gs-plugin-appstream.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index 488db5384..383aa1f06 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -1425,6 +1425,7 @@ list_apps_thread_cb (GTask        *task,
        GsCategory *category = NULL;
        GsAppQueryTristate is_installed = GS_APP_QUERY_TRISTATE_UNSET;
        guint64 age_secs = 0;
+       const gchar * const *deployment_featured = NULL;
        g_autoptr(GError) local_error = NULL;
 
        assert_in_worker (self);
@@ -1435,8 +1436,8 @@ list_apps_thread_cb (GTask        *task,
                is_featured = gs_app_query_get_is_featured (data->query);
                category = gs_app_query_get_category (data->query);
                is_installed = gs_app_query_get_is_installed (data->query);
+               deployment_featured = gs_app_query_get_deployment_featured (data->query);
        }
-
        if (released_since != NULL) {
                g_autoptr(GDateTime) now = g_date_time_new_now_utc ();
                age_secs = g_date_time_difference (now, released_since) / G_TIME_SPAN_SECOND;
@@ -1448,7 +1449,8 @@ list_apps_thread_cb (GTask        *task,
             is_curated == GS_APP_QUERY_TRISTATE_UNSET &&
             is_featured == GS_APP_QUERY_TRISTATE_UNSET &&
             category == NULL &&
-            is_installed == GS_APP_QUERY_TRISTATE_UNSET) ||
+            is_installed == GS_APP_QUERY_TRISTATE_UNSET &&
+            deployment_featured == NULL) ||
            is_curated == GS_APP_QUERY_TRISTATE_FALSE ||
            is_featured == GS_APP_QUERY_TRISTATE_FALSE ||
            is_installed == GS_APP_QUERY_TRISTATE_FALSE ||
@@ -1497,6 +1499,13 @@ list_apps_thread_cb (GTask        *task,
                return;
        }
 
+       if (deployment_featured != NULL &&
+           !gs_appstream_add_deployment_featured (self->silo, deployment_featured, list,
+                                                  cancellable, &local_error)) {
+               g_task_return_error (task, g_steal_pointer (&local_error));
+               return;
+       }
+
        g_task_return_pointer (task, g_steal_pointer (&list), g_object_unref);
 }
 


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