[Feature] Support on-the-fly extraction for single-file archives on download (?extract=true)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
The request centers on the ROM content download endpoint (GET /api/roms/{id}/content/{file_name}) and on how rahasher.py invokes the bundled 7zz binary. Start by reading how archives are listed and where the cache directory under ROMM_TMP_PATH is used, then check how X-Accel-Redirect is currently set for downloads. Done means a single-file archive with ?extract=true streams uncompressed with a correct Content-Length, while multi-file archives return 400 or 406; design choices about caching and cleanup are still open.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
Many users store their ROM libraries compressed (.zip / .7z) on their server to save storage space. However, when third-party console and handheld clients (such as Nintendo 3DS, PS Vita, Wii, or Xbox 360 homebrew downloaders) fetch ROMs over HTTP, extracting archives on-device is severely bottlenecked by slow CPUs, low RAM, and slow SD/storage I/O. On devices like the 3DS, downloading a .zip and extracting it locally forces double SD card I/O and requires 2x free storage space, making the process several times slower than streaming an uncompressed file over Wi-Fi.
While existing issues like #2619 propose permanently decompressing files inside the server's library storage on disk, there is currently no way to keep the library compressed on the server while delivering single-file ROMs uncompressed on demand during download
Describe the solution you'd like
Add an optional query parameter to the download endpoint (e.g., GET /api/roms/{id}/content/{file_name}?extract=true) for single-file archives:
-
Inspect the archive to verify it contains a single ROM file (excluding multi-file archives or returning 400/406 if multiple files are present so behavior stays predictable).
-
Reuse RomM's existing 7zz extraction tooling (already bundled and used by rahasher.py) to extract the file into a temporary cache directory (similar to $ROMM_TMP_PATH/cache/converts).
-
Serve the extracted file directly via nginx X-Accel-Redirect with the uncompressed filename and accurate Content-Length header so clients can stream it straight to storage in a single pass.
Describe alternatives you've considered
• Storing the entire library uncompressed on the server (#2619): Significantly increases NAS/server storage usage for DS, 3DS, and disc-based systems.
• Using rom-converto (?format=): Only handles specific disc/system conversions and does not support extracting standard cartridge/handheld archives (.nds, .cia, .3ds, .gba, etc.) or arbitrary single-file archives.
• Running a custom reverse proxy sidecar: Works locally, but native API support benefits all third-party console/handheld RomM clients (such as 3DS, Vita, and Aurora clients).
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rommapp/romm
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rommapp/romm#5857 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
rommapp/romm#4178 · 1 reaction ·
Maintainers usually reply within 1 day
-
[UI/UX] Misaligned number in searchPossibly taken @NevesHenry claimed this today. Openui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
[Bug] Games do not show up in search if more than 2 letters are used.Possibly taken @andest01 claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
rommapp/romm#5853 · 7 comments ·
Maintainers usually reply within 1 day
Similar issues
-
area:print-dispatch
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area/geometry good first issue help wanted kind/doc-mismatch severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Apich-Organization/rssn#295 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
chore claimed
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
schuyler/corvidae#1424 · 2 comments ·
Maintainers usually reply within 1 day