linuxserver / emulatorjs

Self hosted web based retro emulation front end with rom and art management.
379 stars 26 forks source link

Savegame filenames are URL-encoded #137

Closed paparapapapapa closed 3 months ago

paparapapapapa commented 4 months ago

Hi, first of all thank you for your work. I have all up and running on my unraid server and I use this project to play on my MacBook while I primarily use a RPi with RetroPie in the living room. I successfully configured the two to coexist so both use the same share to load the ROMs and a subfolder to save the srm files. The problem I'm experiencing is that EmulatorJS URL-encode the name of the savegames files while RPie doesn't and use the exact same name of the ROM file. Example:

rom name       = My Nice Title.chd
rpie save name = My Nice Title.srm
ejs save name  = My%20Nice%20Title.srm

This leads to EJS to not find the RPie savegames and vice versa. Also, if EJS could save the file with the right name, there would be just one file per content and it would be always up to date from the last system used to play cause of overwrites. Could you please fix this up?

thelamer commented 3 months ago

This change was made 4 months ago as peoples rom names were messing up the ability to load games. (I had a backlog with many complaints)

It can be undone with: (this would need to be run after updating the container as well)

docker exec emulatorjs sh -c 'sed -i "/EJS_gameUrl/c EJS_gameUrl = rom_path + name + rom_extension;" /emulatorjs/frontend/js/index.js'

While I want seamless compatibility I more don't want to deal with people not able to have games work because of a bunch of non sane characters in their zip names.

I think for now it is best for you to apply this change vs making it the norm or configurable via env variable. I am not sure device syncing is the main focus for most people they just want to run some stuff on an iPhone or any random device.

You can also make this sticky with a custom script https://docs.linuxserver.io/general/container-customization/#custom-scripts. Just an sh file with sed -i "/EJS_gameUrl/c EJS_gameUrl = rom_path + name + rom_extension;" /emulatorjs/frontend/js/index.js in it would do it.

paparapapapapa commented 3 months ago

I totally understand. Also, my use case is kinda peculiar. Anyway, this worked as expected and now I can overwrite my saves from one system to another. Thank you very much!