Files
romm/backend/handler
Georges-Antoine Assi c78424b2a8 fix: reject a duplicate physical game instead of suffixing its name
build_physical_fs_name probed for an existing row and appended " (2)", " (3)"
and so on, which silently minted a second entry for a title the platform
already had. Two copies of one physical game on one platform is not a library
anyone owns, and the unique index on (platform_id, fs_name) already says so.

Drop the loop and its per-creation SELECT: the sanitized name is the fs_name,
and a duplicate falls through to the IntegrityError handler the endpoint
already had. Reword its 409 accordingly, since a duplicate is now the ordinary
way to reach it rather than a race. The add-physical-game dialog already
surfaces `detail` in an error snackbar, so it needs no change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 07:32:18 -04:00
..
2025-12-07 12:19:13 -05:00