Skip to content

Add batch scan processing endpoints #214

@jakebromberg

Description

@jakebromberg

Context

PRs #52 and #53 added library code lookup, reviews API, and the Gemini scanner service (single-scan POST /library/scan). This adds batch processing so a DJ can upload multiple vinyl record images in one request, get a job ID back immediately, and poll for results as each item processes asynchronously via Gemini.

The batch endpoint is the primary workflow: DJs scan stacks of records in quick succession (place-tap-flip-tap-repeat), then review results later in bulk.

Schema

  • scan_jobs table: UUID primary key, user ownership, status enum (pending/processing/completed/failed), item counters
  • scan_results table: per-item results with JSONB context/extraction, status tracking, optional catalog match

Endpoints

  • POST /library/scan/batch — accepts multipart images + JSON manifest, returns 202 with job ID
  • GET /library/scan/batch/:jobId — returns job status with individual results (ownership-checked)

Client Protocol

Flat image upload + JSON manifest:

  • images: all files as a single multer array field
  • manifest: JSON string describing item groupings (imageCount, photoTypes, context per item)
  • Images consumed in order: first N for item 0, next M for item 1, etc.

Validation

  • Max 10 items per batch
  • Max 5 images per item
  • Max 50 total images
  • Image count must match manifest sum

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions