Filter on basalt architecture
This commit is contained in:
+22
-14
@@ -106,21 +106,29 @@ def build_screenshots_html(app):
|
|||||||
screenshots = [{'url': app['screenshot_url']}]
|
screenshots = [{'url': app['screenshot_url']}]
|
||||||
|
|
||||||
if screenshots:
|
if screenshots:
|
||||||
screenshots_html = '<div style="display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: nowrap; overflow-x: auto;">'
|
# Filter screenshots: prefer "basalt" hardware, then fall back to no hardware specified
|
||||||
for idx, screenshot in enumerate(screenshots, 1):
|
basalt_screenshots = [s for s in screenshots if s.get("hardware") == "basalt"]
|
||||||
url = screenshot.get("url", "")
|
if basalt_screenshots:
|
||||||
width = screenshot.get("width", "auto")
|
screenshots = basalt_screenshots
|
||||||
height = screenshot.get("height", "auto")
|
else:
|
||||||
hardware = screenshot.get("hardware", "")
|
screenshots = [s for s in screenshots if not s.get("hardware")]
|
||||||
|
|
||||||
label = f"Screenshot {idx}"
|
|
||||||
if hardware:
|
|
||||||
label += f" ({hardware})"
|
|
||||||
|
|
||||||
if url:
|
|
||||||
screenshots_html += f'<img src="{url}" alt="{label}" title="{label}" width="{width}" height="{height}" style="max-height: 300px; flex-shrink: 0;" />'
|
|
||||||
|
|
||||||
screenshots_html += '</div>'
|
if screenshots:
|
||||||
|
screenshots_html = '<div style="display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: nowrap; overflow-x: auto;">'
|
||||||
|
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'<img src="{url}" alt="{label}" title="{label}" width="{width}" height="{height}" style="max-height: 300px; flex-shrink: 0; margin: 20px;" />'
|
||||||
|
|
||||||
|
screenshots_html += '</div>'
|
||||||
|
|
||||||
return screenshots_html
|
return screenshots_html
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user