mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-19 07:33:18 +02:00
Fix local profiles not shown in AMS slot configuration
The compatible_printers filter on local presets parsed the stored JSON array (e.g. '["BBL X1C 0.4 nozzle"]') as a semicolon-delimited string, so matching always failed and every local preset was silently skipped. Removed the filter entirely — user-imported profiles should be usable on any printer.
This commit is contained in:
@@ -524,22 +524,12 @@ export function ConfigureAmsSlotModal({
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Local presets
|
||||
// 2. Local presets (always shown — user-imported profiles work on any printer)
|
||||
if (localPresets?.filament) {
|
||||
for (const lp of localPresets.filament) {
|
||||
const localId = `local_${lp.id}`;
|
||||
const isSaved = savedId === localId;
|
||||
if (!isSaved && query && !lp.name.toLowerCase().includes(query)) continue;
|
||||
// Filter by compatible_printers if set (skip for saved preset)
|
||||
if (!isSaved && printerModel && lp.compatible_printers) {
|
||||
const compatModels = lp.compatible_printers.split(';').map(p => {
|
||||
// Extract model from "BBL X1C" → "X1C"
|
||||
const trimmed = p.trim();
|
||||
const bblMatch = trimmed.match(/^BBL\s+(.+)/i);
|
||||
return bblMatch ? bblMatch[1].trim().toUpperCase() : trimmed.toUpperCase();
|
||||
}).filter(Boolean);
|
||||
if (compatModels.length > 0 && !compatModels.includes(printerModel.toUpperCase())) continue;
|
||||
}
|
||||
items.push({ id: localId, name: lp.name, source: 'local', isUser: false });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user