Quote lora filenames to handle commas in filenames

Fixes #206
This commit is contained in:
DominikDoom
2023-07-23 11:05:44 +02:00
parent acb85d7bb1
commit de3380818e
6 changed files with 33 additions and 27 deletions

View File

@@ -29,9 +29,9 @@ class LycoParser extends BaseTagParser {
async function load() {
if (lycos.length === 0) {
try {
lycos = (await readFile(`${tagBasePath}/temp/lyco.txt`)).split("\n")
.filter(x => x.trim().length > 0) // Remove empty lines
.map(x => x.trim().split(",")); // Remove carriage returns and padding if it exists, split into name, hash pairs
lycos = (await loadCSV(`${tagBasePath}/temp/lyco.txt`))
.filter(x => x[0].trim().length > 0) // Remove empty lines
.map(x => [x[0].trim(), x[1]]); // Remove carriage returns and padding if it exists, split into name, hash pairs
} catch (e) {
console.error("Error loading lyco.txt: " + e);
}