Upload progress spinner + duplicate game detection
Build & Deploy / build-and-deploy (push) Successful in 1m20s

Two features:

1. Progress indicator: when upload starts, the dialog switches from
   IGDB results to a centered spinner with 'Uploading and processing'
   text + filename. The Cancel button stays visible but disabled.

2. Duplicate game blocking: before upload, checks if a game with the
   same title (case-insensitive) already exists in the library.
   Frontend checks against the loaded games list; backend also
   checks as a second line of defense. Shows ⚠️ message in dialog.
   Existing unique-ID suffix logic (foo-2, foo-3) is still in place
   but now only reached when titles actually differ.
This commit is contained in:
Hermes Agent
2026-05-28 22:28:27 +02:00
parent a9e52ade68
commit e15ce10f5a
2 changed files with 71 additions and 1 deletions
@@ -48,6 +48,15 @@ public class UploadResource {
String gameId = GameService.sanitizeId(title);
// Check for duplicate by title (case-insensitive)
for (var g : svc.list()) {
if (g.getTitle() != null && g.getTitle().equalsIgnoreCase(title)) {
return Response.status(409)
.entity(Map.of("error", "\"" + title + "\" is already in your library"))
.build();
}
}
// Ensure unique ID
String baseId = gameId;
int counter = 2;