aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Kronqvist <work.joelkronqvist@gmail.com>2022-10-24 16:43:53 +0300
committerJoel Kronqvist <work.joelkronqvist@gmail.com>2022-10-24 16:43:53 +0300
commit569fe38f54b21d9b7de5a8b48cbf14987383281d (patch)
tree711b62a7c91708ddcba30d8c41c37b1c729ad260
parenta760ac4091d400b2ae1f461550eed5004b444844 (diff)
downloadLYLLRuoka-569fe38f54b21d9b7de5a8b48cbf14987383281d.tar.gz
LYLLRuoka-569fe38f54b21d9b7de5a8b48cbf14987383281d.zip
Added removal of dumb header in shifts that crashed the parsing
-rw-r--r--classes.txt8
-rw-r--r--dbparse.js1
2 files changed, 1 insertions, 8 deletions
diff --git a/classes.txt b/classes.txt
deleted file mode 100644
index ce5663b..0000000
--- a/classes.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-ÄI7.1: A205
-FY5.2: B102
-MA8.4: B101
-EA5.2: B209
-FI2.6: B103
-EA5.6: B211
-BI4.2: A102
-HI2.4: B210
diff --git a/dbparse.js b/dbparse.js
index a65add0..7e8d8fd 100644
--- a/dbparse.js
+++ b/dbparse.js
@@ -71,6 +71,7 @@ async function writeShifts(data, DB)
DB.query_raw("DELETE FROM shiftnames")
]);
+ data = data.replace(/RUOKAILUVUOROT.*/, "");
const dbOperations = [];
const shiftRegex = /((?:MAANANTAI|TIISTAI|KESKIVIIKKO|TORSTAI|PERJANTAI)?.*)\s*(RUOKAILU.*)\s*(.*)/gmi;
const shifts = data.matchAll(shiftRegex);