From 2aaf713d5818299f26f56187541dcefce51b475e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sat, 20 Feb 2021 23:45:27 +0100 Subject: [PATCH] [Vulcan/Hebe] Add next sync and data removing in grades. --- .../api/edziennik/vulcan/data/hebe/VulcanHebeGrades.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeGrades.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeGrades.kt index 6d78a673..99e38f3f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeGrades.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeGrades.kt @@ -5,8 +5,10 @@ import pl.szczodrzynski.edziennik.data.api.VULCAN_HEBE_ENDPOINT_GRADES import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.DataVulcan import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.ENDPOINT_VULCAN_HEBE_GRADES 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.Grade import pl.szczodrzynski.edziennik.data.db.entity.Metadata +import pl.szczodrzynski.edziennik.data.db.entity.SYNC_ALWAYS import java.text.DecimalFormat import kotlin.math.roundToInt @@ -114,6 +116,11 @@ class VulcanHebeGrades( } onSuccess(ENDPOINT_VULCAN_HEBE_GRADES) + data.toRemove.add( + DataRemoveModel.Grades.semesterWithType(data.studentSemesterNumber, + Grade.TYPE_NORMAL + )) + data.setSyncNext(ENDPOINT_VULCAN_HEBE_GRADES, SYNC_ALWAYS) } } }