From 446a9d61b88beb166b984447f5473aa903b4b9db Mon Sep 17 00:00:00 2001 From: David Alvarez Date: Tue, 26 May 2026 16:47:17 +0200 Subject: [PATCH] feat: all-video media row, clickable media selector, download button - Backend: Add GET /api/games/{id}/download endpoint (ZIP streaming) - Frontend: All videos now shown in media row alongside screenshots - Click any media thumbnail to load it into the media container - Videos show YouTube thumbnail, screenshots show image preview - Active thumbnail has green border highlight - Download button between Edit and Delete triggers ZIP download - Early return: if no media, the entire section is hidden --- frontend/src/lib/api.js | 5 + frontend/src/pages/GameDetail.svelte | 141 ++++++++++++------ src/main/java/com/dostalgia/GameResource.java | 55 +++++++ 3 files changed, 159 insertions(+), 42 deletions(-) diff --git a/frontend/src/lib/api.js b/frontend/src/lib/api.js index 7f859dd..559f640 100644 --- a/frontend/src/lib/api.js +++ b/frontend/src/lib/api.js @@ -84,6 +84,11 @@ export async function scrapeIGDB(gameId, igdbId) { return res.json(); } +/** Download a game's ZIP bundle */ +export function downloadGame(id) { + window.open(`${BASE}/api/games/${id}/download`, '_blank'); +} + /** Check IGDB status */ export async function igdbStatus() { const res = await fetch(`${BASE}/api/igdb/status`); diff --git a/frontend/src/pages/GameDetail.svelte b/frontend/src/pages/GameDetail.svelte index d85f2e8..7245585 100644 --- a/frontend/src/pages/GameDetail.svelte +++ b/frontend/src/pages/GameDetail.svelte @@ -1,5 +1,5 @@