mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 01:58:41 +01:00
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>