[gnome-software] Only show maximum 3 update descriptions if no previous releases are found



commit 56ee7fe4facab8e09e727a11af26358ae9a718c5
Author: Richard Hughes <richard hughsie com>
Date:   Thu Mar 28 11:03:55 2019 +0000

    Only show maximum 3 update descriptions if no previous releases are found
    
    If an app switches from NEWS to AppStream <release> tags we don't want to show
    multiple *years* of release notes on the next flatpak update.
    
    As we can't know the current installed version, just do something more sane
    than showing everything.

 plugins/core/gs-appstream.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index f1b666f6..86e283b6 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -473,6 +473,11 @@ gs_appstream_refine_app_updates (GsPlugin *plugin,
                if (g_hash_table_lookup (installed, version) != NULL)
                        continue;
 
+               /* limit this to three versions backwards if there has never
+                * been a detected installed version */
+               if (g_hash_table_size (installed) == 0 && i >= 3)
+                       break;
+
                /* use the 'worst' urgency, e.g. critical over enhancement */
                urgency_tmp = as_urgency_kind_from_string (xb_node_get_attr (release, "urgency"));
                if (urgency_tmp > urgency_best)


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