playlist importando sample track
Deploy / Deploy (push) Successful in 1m58s
Details
Deploy / Deploy (push) Successful in 1m58s
Details
This commit is contained in:
parent
900d07db08
commit
329afcf2d6
|
|
@ -145,9 +145,18 @@ export async function loadAudioForClip(clip) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const safeUrl = encodeURI(clip.sourcePath).replace(/#/g, "%23");
|
// ✅ NÃO use encodeURI/encodeURIComponent aqui
|
||||||
|
let safeUrl = String(clip.sourcePath);
|
||||||
|
|
||||||
|
// se chegou double-encoded, normaliza (caso %2523 apareça)
|
||||||
|
safeUrl = safeUrl.replace(/%2523/gi, "%23");
|
||||||
|
|
||||||
|
// se chegou com # cru, escapa
|
||||||
|
safeUrl = safeUrl.replace(/#/g, "%23");
|
||||||
|
|
||||||
const response = await fetch(safeUrl);
|
const response = await fetch(safeUrl);
|
||||||
|
|
||||||
|
|
||||||
if (!response.ok)
|
if (!response.ok)
|
||||||
throw new Error(`Falha ao buscar áudio: ${clip.sourcePath}`);
|
throw new Error(`Falha ao buscar áudio: ${clip.sourcePath}`);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -418,8 +418,8 @@ export async function parseMmpContent(xmlString) {
|
||||||
clips.forEach((c, cidx) => {
|
clips.forEach((c, cidx) => {
|
||||||
// resolve caminho via manifest; fallback para /samples
|
// resolve caminho via manifest; fallback para /samples
|
||||||
const src = c.getAttribute("src") || "";
|
const src = c.getAttribute("src") || "";
|
||||||
const fileName = src.split(/[\\/]/).pop(); // "#2.wav"
|
const fileName = src.split(/[\\/]/).pop(); // "sample.wav"
|
||||||
const projectFolder = encodeURIComponent(lastFolder(src) || ""); // "210424"
|
const projectFolder = encodeURIComponent(lastFolder(src) || ""); // "project_name"
|
||||||
const encodedFile = encodeURIComponent(fileName);
|
const encodedFile = encodeURIComponent(fileName);
|
||||||
|
|
||||||
// tenta pelo manifest primeiro
|
// tenta pelo manifest primeiro
|
||||||
|
|
@ -428,7 +428,7 @@ export async function parseMmpContent(xmlString) {
|
||||||
// se o manifest não tiver ou não vier com /{project}/, monta no padrão do servidor
|
// se o manifest não tiver ou não vier com /{project}/, monta no padrão do servidor
|
||||||
if (!resolvedUrl || (projectFolder && !resolvedUrl.includes(`/${projectFolder}/`))) {
|
if (!resolvedUrl || (projectFolder && !resolvedUrl.includes(`/${projectFolder}/`))) {
|
||||||
resolvedUrl = projectFolder
|
resolvedUrl = projectFolder
|
||||||
? `${SAMPLE_SRC}/${projectFolder}/${encodedFile}` // ✅ SAMPLE_SRC/{project}/{file}
|
? `${SAMPLE_SRC}/samples/${projectFolder}/${encodedFile}`
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue