Oprava parsování TechTower

This commit is contained in:
2024-07-08 20:45:09 +02:00
parent 101bd60ddb
commit 91ea07a539
2 changed files with 5 additions and 7 deletions

View File

@@ -294,16 +294,16 @@ export const getMenuTechTower = async (firstDayOfWeek: Date, mock: boolean = fal
}
} else if (parsing) {
if (text.length == 0) {
// Prázdná řádka - končíme (je za pátečním menu TechTower)
break;
// Prázdná řádka - bývá na zcela náhodných místech ¯\_(ツ)_/¯
continue;
}
let price = 'na\xA0váhu';
let name = text;
let name = text.replace('•', '');
if (text.toLowerCase().endsWith('kč')) {
const tmp = text.replace('\xA0', ' ').split(' ');
const split = [tmp.slice(0, -2).join(' ')].concat(tmp.slice(-2));
price = `${split.slice(1)[0]}\xA0Kč`
name = split[0]
name = split[0].replace('•', '');
}
if (result[currentDayIndex] == null) {
result[currentDayIndex] = [];