Sort pages by their number, drop repeated photos, mark uncertain words

The model now wraps words it isn't sure of in {word} or {word|other}; the
reader shows the first reading. Pages are ordered by the number on each
photo and a page photographed twice is kept once (fewer uncertain words,
then more text). meta.photos records which photo goes with which page.
New POST /images/:n/transcribe re-reads a single photo for the editor.
Seeded plays get an img/ folder on their first photo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gVRDXpoukzgMFumoJt
This commit is contained in:
agent 2026-11-04 16:15:27 +00:00
parent 3f2cf95f1d
commit ab842a1d73
8 changed files with 187 additions and 43 deletions

View file

@ -89,7 +89,11 @@ export function createStore(dataDir) {
if (!Number.isInteger(n) || n < 1 || n > 999) throw new NotFound(`${id}/${n}`);
return path.join(dir(id), "img", `${String(n).padStart(3, "0")}.jpg`);
},
async putImage(id, n, buf) { await atomicWrite(this.imagePath(id, n), buf); },
async putImage(id, n, buf) {
const file = this.imagePath(id, n);
await mkdir(path.dirname(file), { recursive: true }); // seeded plays come without img/
await atomicWrite(file, buf);
},
async getImage(id, n) {
try { return await readFile(this.imagePath(id, n)); }
catch (err) { if (err.code === "ENOENT") throw new NotFound(`${id}/${n}`); throw err; }