fix: update Civitai download row keys and LoraManager archive result keys

- Prefix rowKey with sourceKey in resolveDownloadMethods to prevent
  cross-source row collisions by using a composite identifier.
- Update LoraManager archive result check from 'url' to 'download_url'
  to match Civitai API response field naming, and fallback to model card
  URL using download_url to make the open button resilient when the
  direct URL is unavailable.
This commit is contained in:
Dariusz L
2026-06-08 03:39:53 +02:00
parent 93161add4d
commit 0933860dfb
2 changed files with 4 additions and 4 deletions
File diff suppressed because one or more lines are too long
@@ -1419,7 +1419,7 @@ export const resolveDownloadMethods = {
const rowKeys = new Set();
const addRow = (row) => {
if (!row) return;
const rowKey = row.downloadUrl || row.openUrl || `${row.sourceKey}:${row.model}:${row.filename}`;
const rowKey = `${row.sourceKey}:${row.downloadUrl || row.openUrl || `${row.model}:${row.filename}`}`;
if (rowKeys.has(rowKey)) return;
rowKeys.add(rowKey);
rows.push(row);
@@ -1525,7 +1525,7 @@ export const resolveDownloadMethods = {
});
}
if (loraManagerArchiveResult && loraManagerArchiveResult.url) {
if (loraManagerArchiveResult && loraManagerArchiveResult.download_url) {
const archiveFilename = loraManagerArchiveResult.filename || missing.original_path?.split('/').pop()?.split('\\').pop() || '';
const archiveName = loraManagerArchiveResult.name || archiveFilename;
addRow({
@@ -1540,7 +1540,7 @@ export const resolveDownloadMethods = {
downloadUrl: loraManagerArchiveResult.download_url || '',
downloadFilename: archiveFilename,
category: missing.category,
openUrl: loraManagerArchiveResult.url,
openUrl: loraManagerArchiveResult.url || this.getModelCardUrl(loraManagerArchiveResult.download_url),
searchedAt: this.getSearchResultTimestamp(loraManagerArchiveResult)
});
}