Move anti-caching parameter to load function

For less repetition and shorter paths in the higher level functions.
Active by default, but can be disabled.
This commit is contained in:
Dominik Reh
2023-02-10 11:59:06 +01:00
parent cbeced9121
commit d29298e0cc
7 changed files with 16 additions and 13 deletions

View File

@@ -27,7 +27,7 @@ class HypernetParser extends BaseTagParser {
async function load() {
if (hypernetworks.length === 0) {
try {
hypernetworks = (await readFile(`${tagBasePath}/temp/hyp.txt?${new Date().getTime()}`)).split("\n")
hypernetworks = (await readFile(`${tagBasePath}/temp/hyp.txt`)).split("\n")
.filter(x => x.trim().length > 0) //Remove empty lines
.map(x => x.trim()); // Remove carriage returns and padding if it exists
} catch (e) {