update libraries

* spring boot 2.5.5 -> 2.6.6
* kotlin 1.5.31 -> 1.6.20
* coroutines 1.5.2 -> 1.6.1
* gson 2.8.8 -> 2.9.0
* gradle wrapper 7.2 -> 7.4.2
This commit is contained in:
2022-04-08 14:54:06 +02:00
parent f7c8958d20
commit e6f09c11ba
8 changed files with 179 additions and 144 deletions

View File

@ -49,7 +49,7 @@ class APIController {
companion object {
const val apiVersion = "1.3.0"
const val softwareVersion = "1.3.0"
const val softwareVersion = "1.3.1"
val startTime = System.currentTimeMillis() / 1000
}

View File

@ -38,7 +38,8 @@ import java.util.concurrent.Executors
import kotlin.collections.ArrayList
import kotlin.collections.HashSet
import kotlin.concurrent.scheduleAtFixedRate
import kotlin.time.Duration
import kotlin.time.Duration.Companion.hours
import kotlin.time.Duration.Companion.minutes
import kotlin.time.ExperimentalTime
class CacheController {
@ -72,7 +73,7 @@ class CacheController {
val instr = CacheController::class.java.getResourceAsStream("/html/Timetable_normal-week.html")
val timetableParser =
TimetableParser(htmlDoc = Jsoup.parse(instr, "UTF-8", "https://www.hs-offenburg.de/"))
TimetableParser(htmlDoc = Jsoup.parse(instr!!, "UTF-8", "https://www.hs-offenburg.de/"))
val timetableTest = timetableParser.parseTimeTable()
return TimetableCourseWeek(
@ -256,10 +257,10 @@ class CacheController {
private fun scheduledUpdates() {
val currentTime = System.currentTimeMillis()
val duration24h = Duration.hours(24).inWholeMilliseconds
val duration3h = Duration.hours(3).inWholeMilliseconds
val duration1h = Duration.hours(1).inWholeMilliseconds
val duration1m = Duration.minutes(1).inWholeMilliseconds
val duration24h = 24.hours.inWholeMilliseconds
val duration3h = 3.hours.inWholeMilliseconds
val duration1h = 1.hours.inWholeMilliseconds
val duration1m = 1.minutes.inWholeMilliseconds
// Calculate the initial delay to make the update time independent of the start time
fun calcInitDelay(period: Long) = (period - ((currentTime + duration1h) % period)) + duration1m

View File

@ -63,7 +63,7 @@ class MensaParser {
.forEachIndexed { dayIndex, day ->
val strDay = day.select("h3").text()
day.select("div.row").forEachIndexed { mealIndex, meal ->
day.select("div.row").forEachIndexed { _, meal ->
val heading = meal.select("h4.menu-header").text()
val parts = ArrayList(meal.select("div.menu-info").html().substringBefore("<br><span").replace("\n", "").split("<br>"))
val additives = meal.select("span.show-with-allergenes").text()