Description
Description
Thinking about how to make using multiple cd (or other medium) simpler, i had two thoughts:
- Current RA is using m3u files for this purpose in several relevant cores, but the user has to create them manually.
- VFS offer the opportunity to create 'ephemeral' files at runtime.
Yes this idea is a bit crazy and depends on VFS capabilities i'm not certain it has. And since only a few cores have m3u support it might be a false positive until every core that needs to use the RA method to change cds has m3u support.
The idea is the same as my script that creates a m3u file for cd formats it encounters on a dir and then applying that idea to a temporary VFS layer to hide the files that get into the new m3u, and show the new m3u.
The algorithm to create the m3u is very simple:
- find files with applicable extensions in dir. This idea can duplicate m3u for mixed formats like '.cue/iso' vs 'iso'. I'd suggest trying to create m3u with the same name be a non-fatal error and try the 'more complete' fileformats first.
- Sort output of 1. by filename (natural order so 1 isn't followed by 11) output named 'remaining list'
- Iterate over 'remaining list', take 1 file from the list and add to a 'm3u list'.
- Iterate over 'remaining list' again
Peek at the first of the 'remaining list', find largest common substring between first file and peeked file (starting from 0 always).
If that string ends in 'disc #*' (disc followed by 0 or more numbers) or 'cd #*' (cd followed by 0 or more numbers), we assume that the first thing changed on the string is the cd number - this is the heuristic this depends on, the dumping groups all name game cds '(disc 1)' or similar.
Add it to the 'm3u list' if true and remove the first 'remaining list' element, break inner loop otherwise (to create a new m3u). - do 'something' with the 'm3u list you created before the outer loop repeats. Creating a VFS file could happen here. Suggested name for most dumping groups is just strip out the first filename on the list of '(.)|[.]' groupings and any extension if any, and use that + '.m3u'. Or just the name of the first file + '.m3u' if you don't care about it looking good.
I've actually tested this with a large (10% of USA total) redump psx collection and all m3u were created correctly.
This process can be tweaked so nothing happens if the m3u list size == 1 of course. In this case, for a VFS, and assuming that every RA core that wants multiple cds uses m3u and those that don't don't, this 'm3u' is useless (and even harmful if the VFS hides other files that exist on m3u) for cores that don't need m3u.
For VFS suggestions i only have speculations because i don't know what RA makes possible here. My main suggestion is:
- have a setting that named 'use m3u VFS' that applies to the scanner, playlists and the filebrowser.
- this setting applies a overlay filesystem over the native one that creates a m3u on dir listings and hides files in the m3u. Or (simpler alternative) creates the m3u and hides every other file extensions (if all cores that use those extensions can also use m3u). In the later case, you should also allow m3u with size 1 to appear.
The m3u wouldn't be persistent, but more like a 'runtime file'. That's the idea at least.
I have alternative ideas to VFS that would essentially do the same thing but would require intrusive modifications for the filechooser and scanner.
Expected behavior
It should be easy for the user to select a game as a single unit without using pbp, or creating new files. This would require some heuristics that depend on dumping groups naming habits, but since RA already requires 'correct' crcs and it would be a purely runtime optional feature, i don't think anyone would mind.
Actual behavior
This actually requires the user knowing about m3u and when to create them.
Steps to reproduce the bug
N/A
Bisect Results
N/A
Version/Commit
N/A
Environment information
N/A