update all existing courses every 3 hours & some clean up

This commit is contained in:
2019-03-13 19:12:05 +01:00
parent 6de94be329
commit f2c1f2bc58
6 changed files with 89 additions and 47 deletions

View File

@ -43,16 +43,13 @@ class MensaParser {
val heading = day.select("h4")[mealIndex].text()
val parts = ArrayList(meal.html().substringBefore("<br>\n").replace("\n", "").split("<br>"))
val additives = meal.select("span.show-with-allergenes").text()
parts.removeIf { x -> x.isEmpty()|| x.isBlank() }
parts.removeIf { x -> x.isEmpty() || x.isBlank() }
mealWeekList.days[dayIndex].meals.add(Meal(strDay, heading, parts, additives))
}
}
// Mon to Sat (0 - 5)
//println(mealWeekList.days[4])
return mealWeekList
}

View File

@ -51,7 +51,7 @@ class TimetableParser {
var day = 0
// elements are now all lessons, including empty ones
row.select("td.lastcol, td[style]").forEachIndexed {elementIndex, element ->
row.select("td.lastcol, td[style]").forEachIndexed { elementIndex, element ->
// if there is a lecture with rowspan="2", we need to shift everything by one to the left. This is stupid and ugly there needs to bee an API
if ((sDay > -1 && sRow > -1) && (sDay == day && ((sRow + 1) == rowIndex))) {