mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 03:54:17 +02:00
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:
@@ -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}`),
|
||||
|
||||
Reference in New Issue
Block a user