Open rikmarais opened 1 year ago
I think I figured it out.
We encountered another case with spaces in the path, however this time it was on Forge specifically
Game Data/Data/music/Soundboard
I checked the code and found why the issue was happening in Foundry when there are multiple spaces, too.
The problem is in soundboard.js
line 692 and 778, where the returned target is matched to the configured Soundboard Custom Directory
Likely dependent on the OS running the Foundry Server, the target isn't always returned with URL escaped spaces. So doing a .replace(' ', '%20')
won't always be necessary.
Similarly, .replace
will only replace 1 instance of a space, which is why we ran into the problem on Foundry Local running on Windows as soon as more than one space appeared.
Maybe the thing to do is to do a double comparison for both Forge and Foundry local cases: If the target with all spaces replaced matches the setting, OR the target with no spaces replaced matches the setting, proceed
Hi there 👋 I'm not certain whether this is in some way related to issue #89, but I can reproduce this on Forge and on locally hosted Foundry. Tested with Foundry 10.291 and Soundboard 1.7.1.
Perhaps both that issue and this issue are related to path escaping in some way.
Setting the Custom Soundboard Directory sometimes doesn't work
!Music
works fineMusic Stuff
works fineMaster Music Files
doesn't work!Master_Music_Files
works fine!Master Music Files
doesn't work1 2 3
doesn't workCommon denominator seems to be number of spaces, and not special characters, but I didn't look deeply into the code. Hopefully this helps out in finding the issue!