From c6cc1e3a9e6c95011bdfae7ccf0fecce899a364d Mon Sep 17 00:00:00 2001 From: "Matthias@Dell" Date: Thu, 18 May 2023 10:59:52 +0200 Subject: [PATCH] remove 0-count elements from platform/browser ranking --- regina/data_visualization/ranking.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/regina/data_visualization/ranking.py b/regina/data_visualization/ranking.py index 07c953f..f648257 100644 --- a/regina/data_visualization/ranking.py +++ b/regina/data_visualization/ranking.py @@ -183,7 +183,9 @@ def _get_platform_or_browser_ranking(db: Database, timestamps: tuple[int, int], AND r.time BETWEEN {timestamps[0]} AND {timestamps[1]} ) {'AND v.is_human = 1' if only_human else ''}""") - ranking.append((db.fetchone()[0], name)) + count = db.fetchoone()[0] + if count > 0: + ranking.append((count, name)) ranking.sort() return ranking