From 3d13d6a1641f0d62b97e7d9984104e6f9939ebb7 Mon Sep 17 00:00:00 2001 From: djib Date: Sat, 12 Sep 2026 10:26:13 +0200 Subject: [PATCH] Filter on basalt architecture --- rss-generator.py | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/rss-generator.py b/rss-generator.py index 3a75441..0bad1c5 100644 --- a/rss-generator.py +++ b/rss-generator.py @@ -106,21 +106,29 @@ def build_screenshots_html(app): screenshots = [{'url': app['screenshot_url']}] if screenshots: - screenshots_html = '
' - for idx, screenshot in enumerate(screenshots, 1): - url = screenshot.get("url", "") - width = screenshot.get("width", "auto") - height = screenshot.get("height", "auto") - hardware = screenshot.get("hardware", "") - - label = f"Screenshot {idx}" - if hardware: - label += f" ({hardware})" - - if url: - screenshots_html += f'{label}' + # Filter screenshots: prefer "basalt" hardware, then fall back to no hardware specified + basalt_screenshots = [s for s in screenshots if s.get("hardware") == "basalt"] + if basalt_screenshots: + screenshots = basalt_screenshots + else: + screenshots = [s for s in screenshots if not s.get("hardware")] - screenshots_html += '
' + if screenshots: + screenshots_html = '
' + for idx, screenshot in enumerate(screenshots, 1): + url = screenshot.get("url", "") + width = screenshot.get("width", "auto") + height = screenshot.get("height", "auto") + hardware = screenshot.get("hardware", "") + + label = f"Screenshot {idx}" + if hardware: + label += f" ({hardware})" + + if url: + screenshots_html += f'{label}' + + screenshots_html += '
' return screenshots_html