fix: queue stuck on "Busy" for "Any Model" jobs (#435)

When a print was queued with "Any [Model]", the queue widget only
queried items with printer_id=X after dispatch, missing the next
pending model-based item (printer_id IS NULL, target_model="P1S").
The "Clear Plate & Start Next" button never appeared, leaving the
scheduler stuck reporting "Busy".

Add optional target_model query parameter to GET /queue/. When
combined with printer_id, uses OR logic to also return unassigned
items whose target_model matches. The frontend now passes the
printer's model through PrinterQueueWidget to this query.
This commit is contained in:
maziggy
2026-02-19 14:22:28 +01:00
parent 72d4cea467
commit 5e6c04f303
7 changed files with 31 additions and 10 deletions
+2 -1
View File
@@ -3188,10 +3188,11 @@ export const api = {
request<HASensorEntity[]>('/smart-plugs/ha/sensors'),
// Print Queue
getQueue: (printerId?: number, status?: string) => {
getQueue: (printerId?: number, status?: string, targetModel?: string) => {
const params = new URLSearchParams();
if (printerId) params.set('printer_id', String(printerId));
if (status) params.set('status', status);
if (targetModel) params.set('target_model', targetModel);
return request<PrintQueueItem[]>(`/queue/?${params}`);
},
getQueueItem: (id: number) => request<PrintQueueItem>(`/queue/${id}`),