library: the walk position belongs to the origin, so the app beside the browser carries a reading on instead of listing the roll again

This commit is contained in:
2026-09-30 16:26:42 +07:00
parent 851563ed73
commit 325d5c0470
3 changed files with 238 additions and 10 deletions
+4 -3
View File
@@ -893,13 +893,14 @@ step('and taking it reads the folder again', (await page.$$eval(thumbs, (els) =>
// the roll again, every folder is listed a second time, and the counter starts
// from zero while the frames it already holds are read again to be skipped.
//
// The position belongs to the tab now, so the reading carries on instead of
// The position belongs to the origin now, so the reading carries on instead of
// starting over. `check.hold` stops the reading on the frame it is reading, which
// is where a reload lands — and the reading it left behind is still there when the
// key goes, so the same reading finishes the roll. Everything is taken out of the
// catalogue first, so the reading has frames on both sides of the reload.
await page.evaluate(async () => {
sessionStorage.clear();
localStorage.removeItem('recipescam.library.walk.CheckRoll');
localStorage.setItem('check.hold', '1');
const db = await new Promise((resolve, reject) => {
const req = indexedDB.open('recipescam-library');
@@ -913,10 +914,10 @@ await page.evaluate(async () => {
tx.onerror = () => reject(tx.error);
});
});
// The position the tab is holding, the line the toolbar reads out, and the wait
// The position the origin is holding, the line the toolbar reads out, and the wait
// for it: the line is how far the reading has come, and it is the one thing on
// screen that says whether a reading started over.
const position = () => page.evaluate(() => JSON.parse(sessionStorage.getItem('recipescam.library.walk.CheckRoll') ?? 'null'));
const position = () => page.evaluate(() => JSON.parse(localStorage.getItem('recipescam.library.walk.CheckRoll') ?? 'null'));
const readout = () => page.$eval('[data-key="lib-progress"]', (e) => e.textContent ?? '').catch(() => '');
const counting = () =>
page.waitForFunction(