[Feature] Arcade: scan a `<shortname>/` folder of CHDs as part of `<shortname>.zip`

Open
#5,696 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
57/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start with _discover_structured_roms in backend/handler/filesystem/roms_handler.py and trace how it handles folders at the game level on MAME_SHORTNAME_PLATFORMS. Check the existing scanner tests for structured ROMs and MAME shortname platforms. Done means a folder containing only .chd files is attached to a same-stem zip on those platforms, scans as no separate game, and its files appear with the zip's ROM.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.

MAME machines that need disk images (CHDs) are laid out flat. The CHDs go in a folder named after the romset, beside its zip:

roms/arcade/
├── area51.zip
├── area51/
│   └── area51.chd
├── kinst.zip
└── kinst/
    └── kinst.chd

This is how MAME finds them: it looks for disks in <rompath>/<shortname>/. The libretro arcade guide documents the same layout for the mame core, and ES-DE uses it too. ES-DE hides folders that hold no files with a ROM extension, so area51/ never shows up as a game there.

In RomM, _discover_structured_roms (backend/handler/filesystem/roms_handler.py, master at 71f6cdf5) treats each folder at the {game} level as one multi-file ROM. So on arcade and mame:

  • area51/ scans as a second game next to area51.zip, holding only the CHD. Both entries resolve to the same title through the MAME shortname index.
  • Nothing links the two, so downloading or playing area51.zip doesn't include its CHD.

The only way around it today is to add every such folder to exclude.roms.multi_file.names. That list is global, not per platform. It needs one entry per CHD machine (hundreds in a full set), and has to be kept up to date as the library changes.

Describe the solution you'd like

On platforms in MAME_SHORTNAME_PLATFORMS, when a folder holds only .chd files and a zip with the same stem sits beside it, don't list the folder as a ROM of its own. Attach its files to the zip's ROM instead, the way a multi-file ROM carries its parts. Downloads and the Files tab would then include the CHDs, and the scan would show one game per machine.

Describe alternatives you've considered

  • Excluding the folders by name: the workaround above. It's global, per shortname, and has to be maintained by hand.
  • Moving the zip into its folder (area51/area51.zip plus area51/area51.chd), so RomM sees one multi-file game: MAME then looks for the CHD in area51/area51/ and doesn't find it, unless every emulator's rompath is changed.
  • A per-platform structure template (filesystem.structure.<fs_slug>): a template decides which levels are games, but at the {game} level every folder is still a game.

Additional context

  • The same layout appears in software lists (<list>/<software>/<disk>.chd), where the zip and its disk folder share the software's name.
  • Related, but not the same: #3512 (sample archives for EmulatorJS), #2707 (download options for multi-file games), #5272 (arcade platform slugs).
  • AI disclosure: an AI assistant (Claude Code) helped research and draft this issue. The behaviour described was checked against RomM's source at 71f6cdf5.
Dominant language
Python
Stars
13.3k
Forks
747
Avg merge
20h 58m
Merged PRs (30d)
207

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rommapp/romm

All issues in rommapp/romm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.