mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
Enhance CivitAI metadata fetch handling and update virtual scroller item management. See #227
This commit is contained in:
@@ -471,6 +471,11 @@ export async function refreshSingleModelMetadata(filePath, modelType = 'lora') {
|
||||
const data = await response.json();
|
||||
|
||||
if (data.success) {
|
||||
// Use the returned metadata to update just this single item
|
||||
if (data.metadata && state.virtualScroller) {
|
||||
state.virtualScroller.updateSingleItem(filePath, data.metadata);
|
||||
}
|
||||
|
||||
showToast('Metadata refreshed successfully', 'success');
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -81,11 +81,7 @@ export async function fetchCivitai() {
|
||||
|
||||
// Refresh single checkpoint metadata
|
||||
export async function refreshSingleCheckpointMetadata(filePath) {
|
||||
const success = await refreshSingleModelMetadata(filePath, 'checkpoint');
|
||||
if (success) {
|
||||
// Reload the current view to show updated data
|
||||
await resetAndReload();
|
||||
}
|
||||
await refreshSingleModelMetadata(filePath, 'checkpoint');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -117,11 +117,7 @@ export async function refreshLoras(fullRebuild = false) {
|
||||
}
|
||||
|
||||
export async function refreshSingleLoraMetadata(filePath) {
|
||||
const success = await refreshSingleModelMetadata(filePath, 'lora');
|
||||
if (success) {
|
||||
// Reload the current view to show updated data
|
||||
await resetAndReload();
|
||||
}
|
||||
await refreshSingleModelMetadata(filePath, 'lora');
|
||||
}
|
||||
|
||||
export async function fetchModelDescription(modelId, filePath) {
|
||||
|
||||
Reference in New Issue
Block a user