From f0bd5bffaa5e9b930b38c0d00ecad3a732bb75c9 Mon Sep 17 00:00:00 2001 From: jeromew Date: Wed, 22 Oct 2025 21:39:08 +0200 Subject: [PATCH 1/2] Fix sampler.mjs githubPath PR https://codeberg.org/uzu/strudel/pulls/1679 introduced a subtle bug when both other and subpath are empty. The url should not end with '//' --- packages/superdough/sampler.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/superdough/sampler.mjs b/packages/superdough/sampler.mjs index 14e6d3fa3..8aba9d26d 100644 --- a/packages/superdough/sampler.mjs +++ b/packages/superdough/sampler.mjs @@ -129,9 +129,10 @@ function githubPath(base, subpath = '') { let repo = components.length >= 2 ? components[1] : 'samples'; let branch = components.length >= 3 ? components[2] : 'main'; let other = components.slice(3); + other.push(subpath ? subpath : '') other = other.join('/'); - return `https://raw.githubusercontent.com/${user}/${repo}/${branch}/${other}/${subpath}`; + return `https://raw.githubusercontent.com/${user}/${repo}/${branch}/${other}`; } export const processSampleMap = (sampleMap, fn, baseUrl = sampleMap._base || '') => { From ea91d30ce48ee0d6abc1d92669bb2f19e7e0a0e7 Mon Sep 17 00:00:00 2001 From: jeromew Date: Wed, 22 Oct 2025 21:52:53 +0200 Subject: [PATCH 2/2] Add semicolon --- packages/superdough/sampler.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/superdough/sampler.mjs b/packages/superdough/sampler.mjs index 8aba9d26d..84bac3582 100644 --- a/packages/superdough/sampler.mjs +++ b/packages/superdough/sampler.mjs @@ -129,7 +129,7 @@ function githubPath(base, subpath = '') { let repo = components.length >= 2 ? components[1] : 'samples'; let branch = components.length >= 3 ? components[2] : 'main'; let other = components.slice(3); - other.push(subpath ? subpath : '') + other.push(subpath ? subpath : ''); other = other.join('/'); return `https://raw.githubusercontent.com/${user}/${repo}/${branch}/${other}`;