[gnome-software/1630-new-updated-apps-are-not-actually-new: 6/9] gs-appstream: Set also release date in gs_appstream_add_recent()




commit b7355799ff13e244f6b9e24a9210f7b054a8451c
Author: Milan Crha <mcrha redhat com>
Date:   Fri Feb 25 12:17:33 2022 +0100

    gs-appstream: Set also release date in gs_appstream_add_recent()
    
    It can be used to sort the applications by the release date, thus
    provide it without a need to a full app refine.

 lib/gs-appstream.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/lib/gs-appstream.c b/lib/gs-appstream.c
index 0334447c4..861d1d6dc 100644
--- a/lib/gs-appstream.c
+++ b/lib/gs-appstream.c
@@ -1619,8 +1619,13 @@ gs_appstream_add_recent (GsPlugin *plugin,
        for (guint i = 0; i < array->len; i++) {
                XbNode *component = g_ptr_array_index (array, i);
                g_autoptr(GsApp) app = gs_appstream_create_app (plugin, silo, component, error);
+               guint64 timestamp;
                if (app == NULL)
                        return FALSE;
+               /* set the release date */
+               timestamp = component_get_release_timestamp (component);
+               if (timestamp != G_MAXUINT64)
+                       gs_app_set_release_date (app, timestamp);
                gs_app_list_add (list, app);
        }
        return TRUE;


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