From 91ea07a539a4b78c59fa1c359e3890c3d719ba58 Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Mon, 8 Jul 2024 20:45:09 +0200 Subject: [PATCH] =?UTF-8?q?Oprava=20parsov=C3=A1n=C3=AD=20TechTower?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.tsx | 4 +--- server/src/restaurants.ts | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 046d6b7..c91522c 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -369,9 +369,7 @@ function App() { Poslední změny: {dayIndex != null && diff --git a/server/src/restaurants.ts b/server/src/restaurants.ts index 7703a0e..7cc3c82 100644 --- a/server/src/restaurants.ts +++ b/server/src/restaurants.ts @@ -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] = [];