diff --git a/apps/server/src/integrations/import/services/import-attachment.service.ts b/apps/server/src/integrations/import/services/import-attachment.service.ts index a797ecc6..a4da955d 100644 --- a/apps/server/src/integrations/import/services/import-attachment.service.ts +++ b/apps/server/src/integrations/import/services/import-attachment.service.ts @@ -335,6 +335,28 @@ export class ImportAttachmentService { unwrapFromParagraph($, $vid); } + // audio + for (const audEl of $('audio').toArray()) { + const $aud = $(audEl); + const src = cleanUrlString($aud.attr('src') ?? '')!; + if (!src || src.startsWith('http')) continue; + + const relPath = resolveRelativeAttachmentPath( + src, + pageDir, + attachmentCandidates, + ); + if (!relPath) continue; + + const { attachmentId, apiFilePath } = processFile(relPath); + + $aud + .attr('src', apiFilePath) + .attr('data-attachment-id', attachmentId); + + unwrapFromParagraph($, $aud); + } + //