Skip to content

[Bug] Firmware/BIOS entries whose files are gone can't be cleaned up, and are still offered to the emulator #4075

Description

@Spinnich

RomM version
5.1.0 (also present on current master, e7c2362)

Describe the bug
When a ROM file disappears from disk, RomM flags it and gives you a place to deal with
it: Settings → Library Management → Missing, which lists every missing ROM across the
whole library, lets you filter by platform, and has a "Cleanup all" button that deletes
the stale database rows in one go.

Firmware (BIOS) files get flagged the same way by a scan, but there is no equivalent
place to clean them up. The only way to find a stale BIOS entry is to open each
platform's Firmware tab one at a time and look for rows drawn with a strikethrough,
then delete them by hand. On a library with dozens of platforms, that's not a realistic
way to keep things tidy, and there's nothing that tells you a cleanup is even needed.

Two things go wrong as a result of those stale entries sticking around:

  1. The emulator still offers them. The BIOS dropdown in the browser player lists
    every firmware entry for the platform, including ones whose file no longer exists.
    Worse, when a platform has exactly one firmware entry, RomM auto-selects it (added in
    Auto-select firmware when only one option is available #3150). If that one entry is stale, the game just fails to load with no explanation
    pointing at the BIOS.

  2. Firmware counts are wrong. The firmware count shown for a platform includes
    entries whose files are gone, so a platform with no usable BIOS at all can still
    claim to have several.

To Reproduce

  1. Put a BIOS file in the firmware folder for a platform (e.g. bios/ps/scph5501.bin,
    or ps/bios/scph5501.bin depending on your library layout) and run a scan. It shows
    up under the platform's Firmware tab.
  2. Delete or move that file on disk, then run a scan again. The entry is now flagged as
    missing — the row is struck through in the Firmware tab.
  3. Go to Settings → Library Management. There are only three tabs — Folder mapping,
    Excluded, and Missing — and the Missing tab covers ROMs only. There is no missing-
    firmware view and no cleanup action anywhere.
  4. Open a game for that platform in the browser player and look at the BIOS selector in
    the Setup panel. The deleted file is still listed and selectable. If it was the only
    firmware entry for the platform, it is pre-selected, and the game fails to start.

Expected behavior

Stale firmware entries should be as easy to clean up as stale ROM entries. Concretely:

  • A way to see all missing firmware across the library in one place, and remove it in
    bulk — either a firmware section in the existing Missing tab, or a "Cleanup missing
    firmware" task alongside the existing "Cleanup missing ROMs" one.
  • Firmware whose file is missing should not be offered as a BIOS choice in the player,
    and definitely should not be auto-selected. If it is shown, it should be clearly
    marked and unselectable.
  • Platform firmware counts should reflect firmware that actually exists on disk.

Additional context

The database flag already exists and is set correctly — this is only about there being
no way to act on it. For anyone digging in:

  • mark_missing_firmware in backend/handler/database/firmware_handler.py sets the
    flag during a scan, mirroring mark_missing_roms.
  • cleanup_missing_roms in backend/tasks/manual/ is the ROM-side cleanup task; there
    is no firmware counterpart registered in backend/endpoints/tasks.py.
  • GET /api/firmware returns every entry with no way to filter out or identify missing
    ones server-side, which is why both the player's BIOS list and the platform firmware
    count include them.

This affects both the classic and the new UI. Neither has a bulk cleanup path; the new
UI at least marks missing entries in the platform Firmware tab.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions