From b31bf5c1abf4f2b3d07a5713dcefe059e26db66e Mon Sep 17 00:00:00 2001 From: Czapla <56671347+Antoni-Czaplicki@users.noreply.github.com> Date: Thu, 9 Sep 2021 23:13:39 +0200 Subject: [PATCH] [API/Vulcan] Fix missing timetable entries. (#67) --- .../api/edziennik/vulcan/data/hebe/VulcanHebeTimetable.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeTimetable.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeTimetable.kt index 03a28a9e..ffbb0289 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeTimetable.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeTimetable.kt @@ -11,6 +11,7 @@ import pl.szczodrzynski.edziennik.data.api.VULCAN_HEBE_ENDPOINT_TIMETABLE_CHANGE import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.DataVulcan import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.ENDPOINT_VULCAN_HEBE_TIMETABLE import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.data.VulcanHebe +import pl.szczodrzynski.edziennik.data.api.models.DataRemoveModel import pl.szczodrzynski.edziennik.data.db.entity.Lesson import pl.szczodrzynski.edziennik.data.db.entity.Lesson.Companion.TYPE_CANCELLED import pl.szczodrzynski.edziennik.data.db.entity.Lesson.Companion.TYPE_CHANGE @@ -47,7 +48,7 @@ class VulcanHebeTimetable( ?: previousWeekStart val dateTo = dateFrom.clone().stepForward(0, 0, 13) - val lastSync = null + val lastSync = 0L apiGetList( TAG, @@ -106,6 +107,8 @@ class VulcanHebeTimetable( "Clearing lessons between ${dateFrom.stringY_m_d} and ${dateTo.stringY_m_d}" ) + data.toRemove.add(DataRemoveModel.Timetable.between(dateFrom, dateTo)) + data.lessonList.addAll(lessonList) data.setSyncNext(ENDPOINT_VULCAN_HEBE_TIMETABLE, SYNC_ALWAYS)