fix: importer bugs and editor bugs

This commit is contained in:
2026-02-14 21:24:01 +01:00
parent b036cf3c46
commit 4b31d9d421
9 changed files with 281 additions and 24 deletions

View File

@@ -336,8 +336,11 @@ export function registerIpcHandlers(): void {
});
safeHandle('media:getUrl', async (_, id: string) => {
// Returns the bds-media:// protocol URL for a media item
return `bds-media://${id}`;
// Returns the relative path for a media item (e.g. media/2025/01/uuid.jpg)
// This is the format used in markdown content for image references
const engine = getMediaEngine();
const relativePath = await engine.getRelativePath(id);
return relativePath ?? `media/${id}`;
});
safeHandle('media:getFilePath', async (_, id: string) => {