mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
Adds GET /slicer-plugin/info and POST /slicer-plugin/uploads, which take a sliced file plus a JSON manifest in one multipart request: what the user asked for (store, or queue a plate x copies on a printer, optionally held for a manual start) and where the file came from (slicer and plugin versions, presets, a model fingerprint kept for later matching). The manifest does not carry the slice's numbers; plates, time, grams and sliced_for_model are read from the file by the library's own parser. The work is delegated rather than re-implemented: the body of POST /library/files becomes a shared ingest_library_upload, and queueing calls POST /queue/ itself, so every validation, compatibility, filament and budget check applies unchanged. Sends are idempotent on a plugin-chosen upload_id, claimed through a unique constraint, released when the attempt fails, taken over when abandoned, and replayed only to the caller who first used it; a retried queue send is otherwise a second print. A missing plate and a key that may not queue are refused before anything is stored. A refusal from the queue keeps the file, reports queue_error and rolls back what that route wrote first, since with billing on it creates the batch before asking for a cost centre. cost_center_id is accepted for the same reason. New table slicer_plugin_uploads, created on startup.