Mirror and zoom the scan preview, strengthen barcode decoding, save failed captures
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
b5defb4e4f
commit
308c0e1ed3
10 files changed
+510
-152
No files matched your search
+3
-2
@@ -1,5 +1,5 @@
|
||||
import { existsSync, readFileSync, statSync } from 'node:fs';
|
||||
import { extname, join, resolve as resolvePath } from 'node:path';
|
||||
import { dirname, extname, join, resolve as resolvePath } from 'node:path';
|
||||
import { staticPath } from './static.ts';
|
||||
import { serve } from '@hono/node-server';
|
||||
import { openDb } from './db.ts';
|
||||
@@ -19,13 +19,14 @@ const MIME: Record<string, string> = {
|
||||
'.ico': 'image/x-icon', '.webmanifest': 'application/manifest+json', '.map': 'application/json',
|
||||
};
|
||||
|
||||
const capturesDir = process.env.BOOKSORTER_CAPTURES ?? join(dirname(dbPath), 'captures');
|
||||
const db = openDb(dbPath);
|
||||
const events = createEventBus();
|
||||
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 });
|
||||
const app = createApp({ port, db, jobs, resolver, renderCardsPdf, renderCalibrationPdf, classNames, events, capturesDir });
|
||||
|
||||
app.get('*', (c) => {
|
||||
if (!existsSync(join(webRoot, 'index.html'))) {
|
||||
|
||||
Reference in new issue
Block a user