Fix lora keyword lookup for deep subfolders

This commit is contained in:
DominikDoom
2023-08-07 15:17:49 +02:00
parent e1598378dc
commit cdf092f3ac
4 changed files with 15 additions and 22 deletions

View File

@@ -41,7 +41,8 @@ async function load() {
async function sanitize(tagType, text) {
if (tagType === ResultType.lyco) {
let multiplier = TAC_CFG.extraNetworksDefaultMultiplier;
let info = await fetchAPI(`tacapi/v1/lyco-info/${text}`)
let finalComponent = text.lastIndexOf("/") > -1 ? text.substring(text.lastIndexOf("/") + 1) : text;
let info = await fetchAPI(`tacapi/v1/lyco-info/${finalComponent}`)
if (info && info["preferred weight"]) {
multiplier = info["preferred weight"];
}