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:
@@ -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
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user