From 6fe435a55dbf6b3ecee63233c5ff4375e894b375 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mar 18 2024 23:34:40 +0000 Subject: DownloadPage: downweight images with type "live-osbuild" This type denotes 'experimental' osbuild-built live images; if and when we make osbuild the "official" builder of lives, they will have the normal 'live' type, not 'live-osbuild'. We should bury these images down the download table, not put them right at the top as we do currently. Signed-off-by: Adam Williamson --- diff --git a/src/wikitcms/page.py b/src/wikitcms/page.py index 36d968c..49340c3 100644 --- a/src/wikitcms/page.py +++ b/src/wikitcms/page.py @@ -581,6 +581,7 @@ class DownloadPage(Page): (("lxde",), 70), (("source",), -10), ) + typescores = ((("live-osbuild",), -300),) # Start by iterating over all images and grouping them by load # (that's imagedict) and keeping a record of each arch we # encounter (that's arches). @@ -603,6 +604,9 @@ class DownloadPage(Page): for values, score in loadscores: if img["subvariant"].lower() in values: img["score"] += score + for values, score in typescores: + if img["type"].lower() in values: + img["score"] += score # The dict values are lists of images. We could use a # DefaultDict here, but faking it is easy too. if desc in imagedict: