Skip to content

Commit

Permalink
Fix: ensure audio link is embedded (#307)
Browse files Browse the repository at this point in the history
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: alex@fileorganizer2000.com <alex@fileorganizer2000.com>
Co-authored-by: aexshafii <alexandre.shafii@gmail.com>
  • Loading branch information
3 people authored Jan 9, 2025
1 parent d36b429 commit 4c262bb
Show file tree
Hide file tree
Showing 2 changed files with 8,352 additions and 6,706 deletions.
14 changes: 10 additions & 4 deletions packages/plugin/inbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export class Inbox {
}
}
},
onComplete: () => {},
onComplete: () => { },
onError: (error: Error) => {
logger.error("Queue processing error:", error);
},
Expand Down Expand Up @@ -689,10 +689,16 @@ async function recommendTagsStep(
async function appendAttachmentStep(
context: ProcessingContext
): Promise<ProcessingContext> {
if (context.attachmentFile) {
context.plugin.app.vault.append(
if (context.attachmentFile && context.containerFile) {
// Use Obsidian's link generation for guaranteed recognition:
const link = context.plugin.app.fileManager.generateMarkdownLink(
context.attachmentFile,
context.containerFile.parent?.path ?? ""
);
// Add '!' prefix to embed the audio file instead of just linking
await context.plugin.app.vault.append(
context.containerFile,
`\n\n![[${context.attachmentFile.name}]]`
`\n\n${link}`
);
}
return context;
Expand Down
Loading

0 comments on commit 4c262bb

Please sign in to comment.