Small improvements
- Improve formatting - Fix some typos - Mini code improvements
This commit is contained in:
@ -48,11 +48,11 @@ class CacheController {
|
||||
scheduledUpdates()
|
||||
}
|
||||
|
||||
companion object{
|
||||
companion object {
|
||||
private val logger: Logger = LoggerFactory.getLogger(CacheController::class.java)
|
||||
|
||||
var courseList = CoursesList(CoursesMeta(), sortedMapOf())
|
||||
var mensaMenu = MensaMenu(MensaMeta(0,""), MensaWeek(), MensaWeek())
|
||||
var mensaMenu = MensaMenu(MensaMeta(0, ""), MensaWeek(), MensaWeek())
|
||||
var timetableList = HashMap<String, TimetableCourseWeek>() // this list contains all timetables
|
||||
|
||||
/**
|
||||
@ -68,7 +68,7 @@ class CacheController {
|
||||
val currentTime = System.currentTimeMillis() / 1000
|
||||
val timetableLink = "https://mosad.xyz"
|
||||
val weekNumberYear = 0
|
||||
val instr = javaClass.getResourceAsStream("/html/Timetable_normal-week.html")
|
||||
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/"))
|
||||
@ -151,7 +151,7 @@ class CacheController {
|
||||
|
||||
/**
|
||||
* this function updates the courseList
|
||||
* during the update process the old data will be returned for a API request
|
||||
* during the update process the old data will be returned for an API request
|
||||
*/
|
||||
private fun asyncUpdateCourseList() = GlobalScope.launch {
|
||||
CourseListParser().getCourseLinks(StartupController.courseListURL)?.let {
|
||||
@ -167,7 +167,7 @@ class CacheController {
|
||||
|
||||
/**
|
||||
* this function updates the mensa menu list
|
||||
* during the update process the old data will be returned for a API request
|
||||
* during the update process the old data will be returned for an API request
|
||||
*/
|
||||
private fun asyncUpdateMensa() = GlobalScope.launch {
|
||||
val mensaCurrentWeek = MensaParser().getMensaMenu(StartupController.mensaMenuURL)
|
||||
@ -183,7 +183,7 @@ class CacheController {
|
||||
|
||||
/**
|
||||
* this function updates all existing timetables
|
||||
* during the update process the old data will be returned for a API request
|
||||
* during the update process the old data will be returned for an API request
|
||||
* a FixedThreadPool is used to make parallel requests for faster updates
|
||||
*/
|
||||
private fun asyncUpdateTimetables() = GlobalScope.launch {
|
||||
|
Reference in New Issue
Block a user