mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-06 14:10:13 -03:00
fix(recipe): resolve recipe metadata update bugs in cache sort, allowed fields, and bulk API routing
- Use safe .get() in RecipeCache._resort_locked instead of itemgetter to prevent KeyError when recipe missing created_date; align sort key with _sort_cache_sync (prefer modified, fallback created_date, fallback 0) - Add base_model to allowed_fields in persistence_service.update_recipe() so the field passes validation - Route bulk base model updates through updateRecipeMetadata() on recipes page instead of generic saveModelMetadata(), matching existing isRecipesPage pattern used in setBulkFavorites and saveBulkTags
This commit is contained in:
@@ -1665,13 +1665,19 @@ export class BulkManager {
|
||||
cancelled = true;
|
||||
});
|
||||
|
||||
const isRecipesPage = state.currentPageType === 'recipes';
|
||||
|
||||
for (const filepath of state.selectedModels) {
|
||||
if (cancelled) {
|
||||
showToast('toast.api.operationCancelled', {}, 'info');
|
||||
break;
|
||||
}
|
||||
try {
|
||||
await getModelApiClient().saveModelMetadata(filepath, { base_model: newBaseModel });
|
||||
if (isRecipesPage) {
|
||||
await updateRecipeMetadata(filepath, { base_model: newBaseModel });
|
||||
} else {
|
||||
await getModelApiClient().saveModelMetadata(filepath, { base_model: newBaseModel });
|
||||
}
|
||||
successCount++;
|
||||
} catch (error) {
|
||||
errorCount++;
|
||||
|
||||
Reference in New Issue
Block a user