Print the subject hierarchy as a tree on cards, remove the QR code

Each card now shows, under the call number, the Library of Congress
outline levels for its class (from the published outline, down to the
narrowest range) followed by the place or topic from the catalogue
record's subject heading, one level per line. Existing books get the
subject part filled in by a background job at startup that changes
nothing else about them.

The QR code and everything that read it are removed; the subjects line
on the card is replaced by the tree.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-19 14:06:50 -07:00
1 parent c9b2c2e8c9
commit 7ae1bcef0a
46 files changed
+8591 -545

No files matched your search

+3 -1
View File
@@ -8,6 +8,7 @@ import { createApp, createEventBus } from './app.ts';
import { createResolver, TemporaryError } from './resolve/resolver.ts';
import { renderCalibrationPdf, renderCardsPdf } from './pdf/render.ts';
import { classNames } from '../shared/lcc-outline.ts';
import { hierarchyOf } from './hierarchy.ts';
const port = Number(process.env.PORT ?? 4321);
const dbPath = process.env.BOOKSORTER_DB ?? 'data/booksorter.db';
@@ -26,7 +27,7 @@ const resolver = createResolver({ fetch: globalThis.fetch, cache: db.cache });
const jobs = createJobs({
db, resolver, onChange: (b) => events.emitBook(b), isTemporary: (e) => e instanceof TemporaryError,
});
const app = createApp({ port, db, jobs, resolver, renderCardsPdf, renderCalibrationPdf, classNames, events, capturesDir });
const app = createApp({ port, db, jobs, resolver, renderCardsPdf, renderCalibrationPdf, classNames, hierarchy: hierarchyOf, events, capturesDir });
app.get('*', (c) => {
if (!existsSync(join(webRoot, 'index.html'))) {
@@ -40,6 +41,7 @@ app.get('*', (c) => {
const server = serve({ fetch: app.fetch, port, hostname: '127.0.0.1' }, () => {
console.log(`Booksorter running at http://localhost:${port}`);
jobs.resume();
jobs.resumeTails();
});
server.on('error', (err: NodeJS.ErrnoException) => {
if (err.code === 'EADDRINUSE') console.error(`Port ${port} is already in use. Is Booksorter already running?`);