Remove base url from sample server and properly handle url schemes

This commit is contained in:
Aria 2025-11-20 12:46:29 -06:00 committed by W-A-James
parent 9fdba6374c
commit d70b758065
No known key found for this signature in database
GPG key ID: 2CE8DBC07DABE749
4 changed files with 16 additions and 6 deletions

View file

@ -1,4 +1,4 @@
import { getCommonSampleInfo } from './util.mjs';
import { getBaseURL, getCommonSampleInfo } from './util.mjs';
import { registerSound, registerWaveTable } from './index.mjs';
import { getAudioContext } from './audioContext.mjs';
import { getADSRValues, getParamADSR, getPitchEnvelope, getVibratoOscillator } from './helpers.mjs';
@ -211,7 +211,7 @@ export async function fetchSampleMap(url) {
// not a browser
return;
}
const base = url.split('/').slice(0, -1).join('/');
const base = getBaseURL(url);
if (typeof fetch === 'undefined') {
// skip fetch when in node / testing
return;