Fix M3U generation to exclude raw .bin tracks when .cue files are present#3100
Merged
Fix M3U generation to exclude raw .bin tracks when .cue files are present#3100
Conversation
… ROM packages Co-authored-by: gantoine <[email protected]>
Copilot
AI
changed the title
[WIP] Fix multifile download to generate correct .m3u for bin/cue games
Fix M3U generation to exclude raw .bin tracks when .cue files are present
Mar 9, 2026
gantoine
approved these changes
Mar 9, 2026
Greptile SummaryThis PR fixes an invalid Key changes:
Observations:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[GET /roms/:id/content] --> B[Resolve files list\noptionally filtered by file_ids]
B --> C{Any .cue files\nin files list?}
C -- Yes --> D[m3u_files = cue_files only]
C -- No --> E[m3u_files = all files]
D & E --> F{DEV_MODE?}
F -- Yes / single file --> G[Return FileResponse directly]
F -- Yes / multi-file --> H[Build in-memory ZIP]
H --> I{rom.has_m3u_file?}
I -- No --> J[Generate .m3u from m3u_files\nwrite into ZIP]
I -- Yes --> K[Skip M3U generation]
J & K --> L[Return ZIP Response]
F -- No / single file --> M[Return FileRedirectResponse]
F -- No / multi-file --> N[Build nginx mod_zip content_lines]
N --> O{rom.has_m3u_file?}
O -- No --> P[Generate .m3u from m3u_files\nappend to content_lines]
O -- Yes --> Q[Skip M3U generation]
P & Q --> R[Return ZipResponse via nginx]
Last reviewed commit: 8a76391 |
Contributor
Test Results (postgresql)945 tests 944 ✅ 2m 8s ⏱️ Results for commit 8a76391. ♻️ This comment has been updated with latest results. |
Contributor
Test Results (mariadb)945 tests 944 ✅ 2m 8s ⏱️ Results for commit 8a76391. ♻️ This comment has been updated with latest results. |
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When downloading a multi-file ROM containing
.bin/.cuepairs, the auto-generated.m3ulisted all files indiscriminately — including raw binary tracks — producing an invalid playlist that emulators misinterpret as multi-disc or fail to load.Changes
DEV_MODEin-memory ZIP and nginxmod_zipproxy): before building the M3U content, filter to only.cuefiles when any are present; fall back to all files otherwise.Before:
After:
This also correctly handles multi-disc bin/cue games, where the M3U should enumerate disc
.cuedescriptors — not individual tracks.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.