Allow root-relative paths for asset library and redirect to their absolute URLs

Allow us to use paths that look local but redirect to respective URLs for files in our asset libraries would be nice. It’d make using modules a lot easier.

Possible example:
/Asset Library/Music/file.mp3
could redirect to
https://assets.forge-vtt.com/[unique-id]/Music/file.mp3

Additionally, some modules, such as Audio Folder, require the path to a folder, but accessing a directory in our Asset Library returns a 403.

The Forge already does that, though it would just be /Music/file.mp3 without the /Asset Library prefix.
Unfortunately I can’t redirect it, I have to proxy it from the server, because if I redirect, you’ll end up with CORS issues since PIXI (the canvas drawing library that Foundry uses) does not use CORS when loading files from the root-relative paths, so when the redirect happens, it tries to access the new URL without CORS which will fail.
This means that using the root-relative paths is not recommended as you would lose in performance (no geo distributed CDN access) and it would put additional strain on the Foundry servers that would be unnecessary.

As for Audio Folder, I don’t know how it works or what it does, but if it uses the Foundry APIs correctly, it should work, so I think it’s doing something wrong. You can’t access a directory in the asset library because of security/privacy reasons, you would need to use the proper APIs to browse its content (with authentication), and file listing is disabled. 403 errors means “unauthorized” in this case.

I know that Playlist Importer for example works with the Forge without problems, for example.

OK, I’ll take a look at the Audio Folder side. Maybe I’m doing something wrong there. Thank you!

I just tried /Music/Album as a folder, and the console threw an error indicating that /Music doesn’t exist.

Hello @KristianSerrano
I am not quite understanding the problem. Is it a module you’re trying to make work, that doesn’t find Music?

As I have personally a Music/ambience and that works totally fine.

If you’re using the Music import module, you’ll have to set it to forgevtt in the settings.

Further, the name is case sensitive. Make sure your folder in the assets library is Music and not music.

A follow up from the discussion that continued on Discord.
The issue comes from the module Audio Folder and the author was notified about the assumption they were making.
The Playlist Importer module was instead suggested and it did the job even better apparently!