Skip to content

ArchiveSource: List the tracks of an archived multi-track file - #558

Open
pmaciel wants to merge 3 commits into
losnoco:mainfrom
pmaciel:fix/archive-multitrack-file
Open

pmaciel wants to merge 3 commits into
losnoco:mainfrom
pmaciel:fix/archive-multitrack-file

Conversation

@pmaciel

@pmaciel pmaciel commented Nov 16, 2026

Copy link
Copy Markdown

This follows on from #557. The Game Boy soundtracks I get from https://www.zophar.net/music come as zips, and dropping one into Cog as it is added a single entry for the GBS, which only ever played the first song, for a length that had nothing to do with it.

Container URLs aren't expanded a second time, so a file with several tracks inside an archive stayed one entry. When an archive holds a single playable file, ArchiveContainer now opens it through the containers and lists its tracks if it has more than one. Archives of several files, and single-track files, are listed exactly as before, without opening anything more. For those tracks to play, ArchiveSource now leaves the track fragment off the URL when opening it. It also implements filesBesideURL: from #557, so the per-track playlists are found inside the zip as well.

Tested with a Debug build: on its own, the zip lists every song of the GBS; together with #557, the zips of Castlevania: The Adventure, Belmont's Revenge and Legends list every track in their playlists' order with its title and length. A zip of VGMs lists exactly as before.

A file with several tracks is listed as one URL per track, the track in
its fragment. ArchiveSource parsed the whole URL, fragment included, so
it looked for a file named "Game.nsf#3" in the archive and found none.
Container URLs aren't expanded a second time, so an archive holding an
NSF, GBS or other file with several tracks was added as one entry that
played only its first track. When an archive holds a single file, open
it through the containers and list its tracks if it has more than one.
Archives of several files, and single-track files, list as before.
So that a plugin finds the files a file comes with, such as its
playlists, inside an archive as it does in a folder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant