steam-rom-manager icon indicating copy to clipboard operation
steam-rom-manager copied to clipboard

Directories ending with .m3u not working

Open ktzee opened this issue 3 years ago • 5 comments

I'm using this approach on Steam Deck to have Emulationstation-DE recognize my multi-cd games as a single entry: https://gitlab.com/es-de/emulationstation-de/-/blob/master/USERGUIDE.md#directories-interpreted-as-files

The problem is that, when it comes to SRM, these directories don't work. SRM seems to handle the directory file as an actual m3u file, which ends up with Duckstation throwing an error: image

As mentioned here, directories containing m3u files would be the way to go for multi-disk games, however, the problem seems to be with the directory name ending with the .m3u extension. So, while these games work when launched through ES-DE, they don't when launched through the Steam entry that SRM adds.

Adding support for directories ending in .m3u would allow better compatibility between SRM and ES-DE when this approach is used.

ktzee avatar Sep 08 '22 20:09 ktzee

The above was happening with the following glob: ${title}@(.cue|.CUE|.chd|.CHD|.ecm|.ECM|.iso|.ISO|.m3u|.M3U|.mds|.MDS|.pbp|.PBP)

Using a glob that allows going into directories, such as the default: **/${title}@(.cue|.CUE|.img|.IMG|.chd|.CHD|.ecm|.ECM|.iso|.ISO|.m3u|.M3U|.mds|.MDS|.pbp|.PBP)

Will cause this: https://hastebin.com/icepohocug.md

1 entry for the directory, 1 entry for the actual m3u, and 1 for each disk.

ktzee avatar Sep 08 '22 20:09 ktzee

So, what seems to be happening is that the regexp in the glob is applied independently of file type. So any file ending with .m3u is treated as an actual m3u file, even a directory file.

ktzee avatar Sep 08 '22 20:09 ktzee

The folder shouldn't have an m3u extension. I mean, I suppose it can, but it doesn't need to.

missionfloyd avatar Sep 12 '22 02:09 missionfloyd

It needs to, if one wants emulationstation-de to not display multiple entries for games with multiple discs.
I linked to the relevant page in ES-DE's documentation.
On Steam Deck, this difference of approaches between ES-DE and SRM means that there's no simple way to deal with multi-disk games.

ktzee avatar Sep 12 '22 05:09 ktzee

Solution 1: Change the folder structure so you only use 1 parser

Glob: **/!(*Discs)/${title}@(.cue|.CUE|.chd|.CHD|.ecm|.ECM|.iso|.ISO|.m3u|.M3U|.mds|.MDS|.pbp|.PBP)

Folders:

Metal Gear Solid/
├Metal Gear Solid.m3u
└Metal Gear Solid Discs/
 ├ Metal Gear Solid (Disc 1).cue
 ├ Metal Gear Solid (Disc 1).bin
 ├ Metal Gear Solid (Disc 2).cue
 └ Metal Gear Solid (Disc 2).bin

Metal Gear Solid.m3u:

./Metal Gear Solid Discs/Metal Gear Solid (Disc 1).cue
./Metal Gear Solid Discs/Metal Gear Solid (Disc 2).cue

Solution 2: Don't change the folder structure and use 2 parser

Glob 1: The following line will not include any files inside a folder ending with .m3u it will also not include the folder ending with .m3u IF the .m3u folder is just after the ROM dir folder (this will still add all the other games that are not in a .m3u folder): **/!(*.m3u)/${title}@(.cue|.CUE|.chd|.CHD|.ecm|.ECM|.iso|.ISO|.m3u|.M3U|.mds|.MDS|.pbp|.PBP)

Glob 2: Then you copy the parser and change the glob to only read .m3u files that are inside a .m3u folder **/*.m3u/${title}@(.m3u|.M3U) You might be able to merge both of these into one single parse using glob-regex but idk how

Folders:

Metal Gear Solid.m3u/
├ Metal Gear Solid (Disc 1).cue
├ Metal Gear Solid (Disc 1).bin
├ Metal Gear Solid (Disc 2).cue
├ Metal Gear Solid (Disc 2).bin
└ Metal Gear Solid.m3u

Metal Gear Solid.m3u (file not folder):

./Metal Gear Solid (Disc 1).cue
./Metal Gear Solid (Disc 2).cue

Notes Ok this issue is not a issue with SRM and ES-DE you are trying to launch DuckStation not ES-DE. ES-DE and SRM are almost the same program a frontend but SRM uses steam as the frontend Also that folder feature is a ES-DE feature it actually gives the emulator the file inside the .m3u folder On my system DuckStation just exits if i drag-and-drop the .m3u folder into the DuckStation window it launches fine if i drop the m3u file

TL;DR: Use the first solution This is my advice

ThomasT75 avatar Sep 14 '22 21:09 ThomasT75

This is an issue with file and folder structure and assumption of SRM somehow magically ignoring what is present. It doesn't work like that, either have your M3U files outside of the folder with multiple discs or alter the parser as shipped to suit your needs as per the above post.

kencinder avatar Mar 18 '23 22:03 kencinder

This is an issue with file and folder structure and assumption of SRM somehow magically ignoring what is present. It doesn't work like that, either have your M3U files outside of the folder with multiple discs or alter the parser as shipped to suit your needs as per the above post.

That's just disorganized and annoying. Maybe the easiest solution is to disable recursion and not enter folders, keeping discs in subdirectories. In whatever root directory ROMs are stored in, all single-disc items in there, and m3us to handle subdirectories. Inside Root ROMs (directory):

.
..
Parasite Eve
Parasite Eve.m3u
Spyro the Dragon [SCUS-94228].chd

Inside Parasite Eve (directory):

.
..
Parasite Eve (1-2) [SLUS-00662].chd
Parasite Eve (2-2) [SLUS-00668].chd

Inside Parasite Eve.m3u (file):

./Parasite Eve/Parasite Eve (1-2) [SLUS-00662].chd
./Parasite Eve/Parasite Eve (2-2) [SLUS-00668].chd

The M3U directory naming is also an interesting approach, especially for compatibility.

I managed to use a glob tester to try and come up with this (works perfectly in a glob test):

{**/{*.m3u/*.m3u,},/*{.cue,.CUE,.img,.IMG,.chd,.CHD,.ecm,.ECM,.iso,.ISO,.mds,.MDS,.pbp,.PBP}}

Only trouble, can't seem to figure out how to introduce ${title} into it.

Edit: Gave up trying to throw up a workaround to this anti-compatibility decision and behavior and just wrote a script to modify the cache (said vdf before, brainfart, tired) to remove any games inside a .m3u directory. ES knows what's up, so do we, dunno why SRM refuses to get with it. Come across quite a few people trying to figure this out in an automated way, either by cleanup or prevention. Just going to stick with cleanup.

OdinVex avatar Jul 02 '23 18:07 OdinVex