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
@@ -9,18 +9,19 @@ import { formatRelativeTime } from '../utils/date';
interface PrinterQueueWidgetProps {
printerId: number;
printerModel?: string | null;
printerState?: string | null;
plateCleared?: boolean;
}
export function PrinterQueueWidget({ printerId, printerState, plateCleared }: PrinterQueueWidgetProps) {
export function PrinterQueueWidget({ printerId, printerModel, printerState, plateCleared }: PrinterQueueWidgetProps) {
const { t } = useTranslation();
const queryClient = useQueryClient();
const { showToast } = useToast();
const { hasPermission } = useAuth();
const { data: queue } = useQuery({
queryKey: ['queue', printerId, 'pending'],
queryFn: () => api.getQueue(printerId, 'pending'),
queryKey: ['queue', printerId, 'pending', printerModel],
queryFn: () => api.getQueue(printerId, 'pending', printerModel || undefined),
refetchInterval: 30000,
});