Add QR codes to cards, stop inventing call number parts
Cards now carry a QR code holding the book's own record (call number, title, authors, ISBN, year), and the scanner reads it back to find or add that book. Call number selection no longer pads catalogue numbers with generated cutters. A number is "exact" only when it comes verbatim from a record for this edition; a bare class is a hint that steers the other-edition and similar-books lookups; a record fetched by LCCN must list the book's ISBN to count as this edition. "Look up again" bypasses every cached result, and shelf order breaks ties by author then title. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
6cec404e21
commit
ad2956e868
56 files changed
+4020
-156
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { acceptRead, markEmitted, newReadState } from './readstate.ts';
|
||||
import { acceptCard, acceptRead, markCardEmitted, markEmitted, newReadState } from './readstate.ts';
|
||||
|
||||
const ISBN = '9780306406157';
|
||||
|
||||
@@ -46,3 +46,13 @@ test('markEmitted silences the loop for 5 s', () => {
|
||||
assert.equal(acceptRead(s, ISBN, 2000).emit, null);
|
||||
assert.equal(acceptRead(s, ISBN, 6100).emit, ISBN);
|
||||
});
|
||||
|
||||
test('a card is announced once per 5 s per text, independently of ISBNs', () => {
|
||||
let r = acceptCard(newReadState(), 'card A', 0);
|
||||
assert.equal(r.emit, 'card A');
|
||||
r = acceptCard(r.state, 'card A', 4900);
|
||||
assert.equal(r.emit, null);
|
||||
assert.equal(acceptCard(r.state, 'card B', 4900).emit, 'card B');
|
||||
assert.equal(acceptCard(r.state, 'card A', 5100).emit, 'card A');
|
||||
assert.equal(acceptCard(markCardEmitted(newReadState(), 'card A', 0), 'card A', 100).emit, null);
|
||||
});
|
||||
Reference in new issue
Block a user