[APIv2/Librus] Fix attendance metadata

This commit is contained in:
Kacper Ziubryniewicz 2019-10-13 16:34:44 +02:00
parent 42b56fa4a2
commit 70d35e12e5

View File

@ -66,14 +66,16 @@ class LibrusApiAttendances(override val data: DataLibrus,
val addedDate = Date.fromIso(attendance.getString("AddDate") ?: return@forEach)
data.attendanceList.add(attendanceObject)
data.metadataList.add(Metadata(
profileId,
Metadata.TYPE_ATTENDANCE,
id,
profile?.empty ?: false,
profile?.empty ?: false,
addedDate
))
if(type != Attendance.TYPE_PRESENT) {
data.metadataList.add(Metadata(
profileId,
Metadata.TYPE_ATTENDANCE,
id,
profile?.empty ?: false,
profile?.empty ?: false,
addedDate
))
}
}
data.setSyncNext(ENDPOINT_LIBRUS_API_ATTENDANCES, SYNC_ALWAYS)