mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-01-26 19:19:57 +00:00
Hotfix for old scripts/wildcards path loading
This commit is contained in:
@@ -413,7 +413,15 @@ function autocomplete(textArea, prompt, fixedTag = null) {
|
||||
let wcFile = wcMatch[0][1];
|
||||
let wcWord = wcMatch[0][2];
|
||||
|
||||
let wildcards = readFile(`file/extensions/wildcards/wildcards/${wcFile}.txt`).split("\n")
|
||||
let wcBasePath = "";
|
||||
if (wildcardExtFiles.includes(wcFile))
|
||||
wcBasePath = "extensions/wildcards/wildcards";
|
||||
else if (wildcardFiles.includes(wcFile))
|
||||
wcBasePath = "scripts/wildcards";
|
||||
else
|
||||
throw "No valid wildcard file found";
|
||||
|
||||
let wildcards = readFile(`file/${wcBasePath}/${wcFile}.txt`).split("\n")
|
||||
.filter(x => x.trim().length > 0); // Remove empty lines
|
||||
|
||||
results = wildcards.filter(x => (wcWord !== null && wcWord.length > 0) ? x.toLowerCase().includes(wcWord) : x) // Filter by tagword
|
||||
|
||||
Reference in New Issue
Block a user