mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-11-24 19:04:38 -06:00
[APIv2/Vulcan] Fix start time in events.
This commit is contained in:
parent
c2f91e6867
commit
d1a5d8cba9
@ -53,10 +53,11 @@ class VulcanApiEvents(override val data: DataVulcan, private val isHomework: Boo
|
||||
val eventDate = Date.fromY_m_d(event.getString("DataTekst") ?: return@forEach)
|
||||
val subjectId = event.getLong("IdPrzedmiot") ?: -1
|
||||
val teacherId = event.getLong("IdPracownik") ?: -1
|
||||
val startTime = data.lessonList.singleOrNull {
|
||||
it.weekDay == eventDate.weekDay && it.subjectId == subjectId
|
||||
}?.startTime
|
||||
val topic = event.getString("Opis") ?: ""
|
||||
|
||||
val lessonList = data.db.timetableDao().getForDateNow(profileId, eventDate)
|
||||
val startTime = lessonList.firstOrNull { it.subjectId == subjectId }?.startTime
|
||||
|
||||
val type = when (isHomework) {
|
||||
true -> Event.TYPE_HOMEWORK
|
||||
else -> when (event.getBoolean("Rodzaj")) {
|
||||
|
Loading…
Reference in New Issue
Block a user