Files
romm/backend/utils
alexcastgonz 54fecf2500 fix(setup): resolve folder aliases when identifying platforms in the setup wizard (#5473)
* fix(setup): resolve folder aliases when identifying platforms in the setup wizard

The setup library endpoint returned raw folder names, so folders such as
gamecube or a config-bound nintendo-snes showed as Unidentified and their
platform stayed in the supported list. Report the resolved platform slug
next to each folder and match on it in the wizard.

Fixes #5465

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(setup): match supported platforms on resolved slug, one detected row per folder

pr-ready step 2 (code-review xhigh --fix): compare supported platforms by
slug so a DB row with an alias fs_slug still matches, keep each folder's own
name and rom count, read config once per request, black-format the new test,
and add a SetupStepPlatforms unit test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(setup): fold detected-row branches, drop redundant selection guards

pr-ready step 3 (simplify): build identified and unidentified rows from one
object, drop the detected checks in togglePlatform and newSlugsInGroup (every
caller already lists only supportedAvailable), and merge the duplicated chip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(setup): assert the resolved slug in every setup/library entry

pr-ready step 4 (review-polish): compare whole existing_platforms entries in
the older setup/library tests so they cover slug too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(setup): tighten detected-row comment

pr-ready step 5 (humanizer).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(settings): resolve built-in folder aliases in folder mappings

Folder Mappings matched folders to platforms on the client by exact slug,
so alias folders like gamecube or megadrive showed as unmapped even though
the scan resolves them. The heartbeat now returns FS_PLATFORM_SLUGS, each
folder's slug from its name or built-in alias, and the table reads it for
auto-detected rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: drop response schema field comments

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
2026-11-08 22:25:29 -05:00
..
2026-07-06 22:17:56 -04:00