Safety check & remove log

This commit is contained in:
DominikDoom
2023-07-23 11:08:29 +02:00
parent de3380818e
commit 0d9d5f1e44
3 changed files with 4 additions and 5 deletions

View File

@@ -30,8 +30,8 @@ async function load() {
if (lycos.length === 0) {
try {
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
.filter(x => x[0]?.trim().length > 0) // Remove empty lines
.map(x => [x[0]?.trim(), x[1]]); // Trim filenames and return the name, hash pairs
} catch (e) {
console.error("Error loading lyco.txt: " + e);
}