mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-07-13 20:21:16 -03:00
fix(download): recognize civitai.red and civitai.green URLs in batch download (#1003)
This commit is contained in:
@@ -463,8 +463,8 @@ export class DownloadManager {
|
|||||||
const trimmed = url.trim();
|
const trimmed = url.trim();
|
||||||
if (!trimmed) return null;
|
if (!trimmed) return null;
|
||||||
|
|
||||||
// CivitAI
|
// CivitAI — matches civitai.com, civitai.red, civitai.green, etc.
|
||||||
if (/civitai\.com\/models\//i.test(trimmed) || /civitaiarchive|civarchive/i.test(trimmed)) {
|
if (/civitai\.(?:com|red|green)\/models\//i.test(trimmed) || /civitaiarchive|civarchive/i.test(trimmed)) {
|
||||||
// Will be parsed by existing CivitAI logic
|
// Will be parsed by existing CivitAI logic
|
||||||
return { type: 'civitai' };
|
return { type: 'civitai' };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,20 @@ describe('DownloadManager.detectUrlType — HF URL detection', () => {
|
|||||||
expect(result).toEqual({ type: 'civitai' });
|
expect(result).toEqual({ type: 'civitai' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('detects CivitAI URL on civitai.red domain', () => {
|
||||||
|
const result = DownloadManager.detectUrlType(
|
||||||
|
'https://civitai.red/models/12345/my-model'
|
||||||
|
);
|
||||||
|
expect(result).toEqual({ type: 'civitai' });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('detects CivitAI URL on civitai.green domain', () => {
|
||||||
|
const result = DownloadManager.detectUrlType(
|
||||||
|
'https://civitai.green/models/67890/another-model'
|
||||||
|
);
|
||||||
|
expect(result).toEqual({ type: 'civitai' });
|
||||||
|
});
|
||||||
|
|
||||||
it('detects CivArchive URL', () => {
|
it('detects CivArchive URL', () => {
|
||||||
const result = DownloadManager.detectUrlType(
|
const result = DownloadManager.detectUrlType(
|
||||||
'https://civarchive.com/models/456'
|
'https://civarchive.com/models/456'
|
||||||
|
|||||||
Reference in New Issue
Block a user