mirror of
https://github.com/Donkie/Spoolman.git
synced 2026-10-22 18:12:18 -05:00
A spool can hold its own full weight, empty-spool (tare) weight and price, falling back to its filament's where it has none. The API has had all three since #339, and the v1 client exposed them, but client_v2 never mapped spool_weight at all and had no field for it or for the full weight. The result was silent wrong arithmetic (#1013): the API gives every spool it creates a copy of the filament's tare weight, so correcting the *filament* later looked like it had worked — the spool panel showed the new figure — while "adjust by measured weight" went on subtracting the old one. A reporter's empty 261 g spool came back with 129 g still on it, exactly the difference. Both ends of a disagreement are now marked. The spool's field says what it shadows, the filament's row says what applies instead and is struck through, and the same treatment covers the manufacturer's empty-spool weight, which seeds a filament and is then left behind. Only where the values actually differ: merely having one of its own is already visible in the field, and marking every spool would teach everyone to stop reading the marks. Also fixes a 500 from PUT /spool/{id}/measure when nothing in the chain has a tare weight — reachable in one click now that the field can be cleared.