Also move the TacUtils class into the namespace for consistency

This commit is contained in:
DominikDoom
2025-07-12 19:01:13 +02:00
parent 87fa3851ca
commit 88c8a1d5d6
11 changed files with 76 additions and 78 deletions

View File

@@ -18,7 +18,7 @@
.replace("<l:", "")
.replace("<", "");
let filterCondition = (x) => {
let regex = new RegExp(TacUtils.escapeRegExp(searchTerm, true), "i");
let regex = new RegExp(TAC.Utils.escapeRegExp(searchTerm, true), "i");
return (
regex.test(x.toLowerCase()) ||
regex.test(x.toLowerCase().replaceAll(" ", "_"))
@@ -52,7 +52,7 @@
if (TAC.Globals.lycos.length === 0) {
try {
TAC.Globals.lycos = (
await TacUtils.loadCSV(`${TAC.Globals.tagBasePath}/temp/lyco.txt`)
await TAC.Utils.loadCSV(`${TAC.Globals.tagBasePath}/temp/lyco.txt`)
)
.filter((x) => x[0]?.trim().length > 0) // Remove empty lines
.map((x) => [x[0]?.trim(), x[1], x[2]]); // Trim filenames and return the name, sortKey, hash pairs
@@ -65,7 +65,7 @@
async function sanitize(tagType, text) {
if (tagType === TAC.ResultType.lyco) {
let multiplier = TAC.CFG.extraNetworksDefaultMultiplier;
let info = await TacUtils.fetchAPI(`tacapi/v1/lyco-info/${text}`);
let info = await TAC.Utils.fetchAPI(`tacapi/v1/lyco-info/${text}`);
if (info && info["preferred weight"]) {
multiplier = info["preferred weight"];
}