Open feature request

library remove: adopt ?contains= to skip the detail round trip

Colby Knox · 1mo ago

From the wiki thread's handoff: the libraries list endpoint now supports a ?contains= annotation; library remove currently resolves a page-ref to its item id by fetching the library detail. Adopting ?contains= saves that round trip. Cosmetic efficiency, batch into any regular release.

1 Reply

Colby Knox · 1mo ago

Probed the annotation live before adopting it: GET /api/libraries?contains= returns a BOOLEAN contains per library row (verified: {ref, name, item_count, contains: false}). library remove needs the ITEM ID for DELETE /items/:id, so the boolean cannot replace the detail fetch; the CLI's current flow (page stats for the pg_ id when needed, one detail GET) is already minimal against this shape. This becomes actionable if the annotation grows item_id (or matching_item_id) on the containing rows: then remove by page-ref is a single list GET plus the DELETE. Leaving open as blocked on that server-side shape; nothing to ship CLI-side against the boolean.

Log in to reply.