Add batch scan processing endpoints#215
Draft
jakebromberg wants to merge 6 commits intofeature/scanner-gemini-integrationfrom
Draft
Add batch scan processing endpoints#215jakebromberg wants to merge 6 commits intofeature/scanner-gemini-integrationfrom
jakebromberg wants to merge 6 commits intofeature/scanner-gemini-integrationfrom
Conversation
Introduces POST /library/scan/batch and GET /library/scan/batch/:jobId endpoints that let DJs upload multiple vinyl record images in one request, get a job ID back immediately (202 Accepted), and poll for results as each item processes asynchronously through Gemini. Schema: scan_jobs and scan_results tables with status enums, cascading deletes, and JSONB columns for context/extraction data. Batch service: createBatchJob (insert + fire-and-forget background processing), getJobStatus (ownership-checked polling), processJobItems (sequential per-item processing with partial failure handling). Validation: max 10 items, max 5 images per item, max 50 total images, manifest image count must match uploaded files.
added 4 commits
March 3, 2026 17:02
The 2.0-flash free tier quota is exhausted and the model is outdated. Gemini 3.1 Pro has better handwriting recognition, which is needed for reading handwritten album reviews and catalog stickers on vinyl records.
The gemini-3.1-pro-preview free tier quota is exhausted (limit: 0). Switch to gemini-3-flash-preview which has available free tier capacity.
Gemini now extracts artist_name and album_title alongside label, catalog number, review text, and UPC. Updated the system prompt, response parsing, and TypeScript types.
…ng fallbacks Batch status responses now include full album details (artist, title, library code, genre, format, label) for matched items by joining library_artist_view, instead of only returning the album ID. Also fix catalog matching to use extracted artist name and album title as fallbacks instead of label name.
This was referenced Mar 4, 2026
Mount the better-auth handler directly in the backend Express app so the iOS library-scanner only needs a single base URL for both auth and API calls. This simplifies the dev environment by eliminating the need for a separate auth service on Railway.
Changes:
- Import auth from @wxyc/authentication and toNodeHandler from better-auth/node
- Mount auth handler at /auth/{*path} (Express 5 path-to-regexp syntax)
- Add test helper endpoints (/auth/test/verification-token, /auth/test/expire-session)
- Add createDefaultUser() and syncAdminRoles() async startup functions
- Wrap server startup in async IIFE to run startup functions before listening
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /library/scan/batchendpoint for uploading multiple vinyl record images with a JSON manifest, returning 202 with a job ID for pollingGET /library/scan/batch/:jobIdendpoint for checking job status with ownership-enforced accessscan_jobsandscan_resultsdatabase tables with status enums, cascading deletes, and JSONB columnsCloses #214
Test plan