feat: support model details for LoraManager archive downloads

Map lora_manager_archive source to Civitai on the details endpoint so LoraManager archive results can retrieve model metadata. Add detailsContext payload to resolve_download_methods and extend model_info_methods to accept lora_manager_archive as a valid source.
This commit is contained in:
Dariusz L
2026-06-08 04:49:41 +02:00
parent 0933860dfb
commit 2a43597c9e
3 changed files with 12 additions and 2 deletions
+3
View File
@@ -886,6 +886,9 @@ class ModelResolverExtension:
except (TypeError, ValueError):
version_id = None
if source == "lora_manager_archive":
source = "civitai"
if source not in {"civitai", "civarchive"}:
return web.json_response(
{"error": "Unsupported model details source"}, status=400
@@ -1541,7 +1541,14 @@ export const resolveDownloadMethods = {
downloadFilename: archiveFilename,
category: missing.category,
openUrl: loraManagerArchiveResult.url || this.getModelCardUrl(loraManagerArchiveResult.download_url),
searchedAt: this.getSearchResultTimestamp(loraManagerArchiveResult)
searchedAt: this.getSearchResultTimestamp(loraManagerArchiveResult),
detailsContext: {
...loraManagerArchiveResult,
source: 'lora_manager_archive',
details_source: 'lora_manager_archive',
missing_key: this.getMissingModelKey(missing),
category: missing.category
}
});
}
+1 -1
View File
@@ -107,7 +107,7 @@ export const modelInfoMethods = {
canShowSourceDetails(model = {}) {
const source = String(model.details_source || model.source || '').toLowerCase();
return model?.context_scope === 'download_table'
&& ['civitai', 'civarchive'].includes(source)
&& ['civitai', 'civarchive', 'lora_manager_archive'].includes(source)
&& Boolean(model.model_id || model.modelId);
},