Filter on basalt architecture
This commit is contained in:
+9
-1
@@ -105,6 +105,14 @@ def build_screenshots_html(app):
|
|||||||
if not screenshots and 'screenshot_url' in app and app['screenshot_url']:
|
if not screenshots and 'screenshot_url' in app and app['screenshot_url']:
|
||||||
screenshots = [{'url': app['screenshot_url']}]
|
screenshots = [{'url': app['screenshot_url']}]
|
||||||
|
|
||||||
|
if screenshots:
|
||||||
|
# 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")]
|
||||||
|
|
||||||
if screenshots:
|
if screenshots:
|
||||||
screenshots_html = '<div style="display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: nowrap; overflow-x: auto;">'
|
screenshots_html = '<div style="display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: nowrap; overflow-x: auto;">'
|
||||||
for idx, screenshot in enumerate(screenshots, 1):
|
for idx, screenshot in enumerate(screenshots, 1):
|
||||||
@@ -118,7 +126,7 @@ def build_screenshots_html(app):
|
|||||||
label += f" ({hardware})"
|
label += f" ({hardware})"
|
||||||
|
|
||||||
if url:
|
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 += f'<img src="{url}" alt="{label}" title="{label}" width="{width}" height="{height}" style="max-height: 300px; flex-shrink: 0; margin: 20px;" />'
|
||||||
|
|
||||||
screenshots_html += '</div>'
|
screenshots_html += '</div>'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user