Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: ensure audio link is embedded #307

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading