fix(library): isolate per-note failures in candidate picker loop
This commit is contained in:
parent
d7162d3ac2
commit
4249952f0a
2 changed files with 38 additions and 4 deletions
|
|
@ -233,10 +233,16 @@ export class LibraryController {
|
|||
skipped++;
|
||||
continue;
|
||||
}
|
||||
const content = await deps.readNote(entry.path);
|
||||
await deps.writeNote(entry.path, patchFrontmatter(content, candidate.patches, { defaultType: spec.itemType }));
|
||||
report.resolved.push(entry.path);
|
||||
picked++;
|
||||
try {
|
||||
const content = await deps.readNote(entry.path);
|
||||
await deps.writeNote(entry.path, patchFrontmatter(content, candidate.patches, { defaultType: spec.itemType }));
|
||||
report.resolved.push(entry.path);
|
||||
picked++;
|
||||
} catch (e) {
|
||||
const msg = e instanceof Error ? e.message : String(e);
|
||||
console.log(`[media-db-library] picker failed for ${entry.filename}: ${msg}`);
|
||||
skipped++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue