[gnome-software/144-handle-release-dates-in-the-future-better] gs-appstream: Handle release dates in the future better



commit 5950d15b53aa4d186791804a269b4aa618c62b52
Author: Milan Crha <mcrha redhat com>
Date:   Mon Oct 19 17:55:27 2020 +0200

    gs-appstream: Handle release dates in the future better
    
    When the release time seemed in the future in compare to the local time,
    then the 'Release Activity' kudo had been made insensitive. Let it be
    sensitive, because it's less than one year when the release date is in
    the future.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/144
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/527

 plugins/core/gs-appstream.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index 2b517c66..3f8fdfac 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -387,7 +387,7 @@ static gboolean
 gs_appstream_is_recent_release (XbNode *component)
 {
        guint64 ts;
-       guint64 secs;
+       gint64 secs;
 
        /* get newest release */
        ts = xb_node_query_attr_as_uint (component, "releases/release", "timestamp", NULL);
@@ -395,7 +395,7 @@ gs_appstream_is_recent_release (XbNode *component)
                return FALSE;
 
        /* is last build less than one year ago? */
-       secs = ((guint64) g_get_real_time () / G_USEC_PER_SEC) - ts;
+       secs = (g_get_real_time () / G_USEC_PER_SEC) - ts;
        return secs / (60 * 60 * 24) < 365;
 }
 


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