forked from github/szkolny
[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 eventDate = Date.fromY_m_d(event.getString("DataTekst") ?: return@forEach)
|
||||||
val subjectId = event.getLong("IdPrzedmiot") ?: -1
|
val subjectId = event.getLong("IdPrzedmiot") ?: -1
|
||||||
val teacherId = event.getLong("IdPracownik") ?: -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 topic = event.getString("Opis") ?: ""
|
||||||
|
|
||||||
|
val lessonList = data.db.timetableDao().getForDateNow(profileId, eventDate)
|
||||||
|
val startTime = lessonList.firstOrNull { it.subjectId == subjectId }?.startTime
|
||||||
|
|
||||||
val type = when (isHomework) {
|
val type = when (isHomework) {
|
||||||
true -> Event.TYPE_HOMEWORK
|
true -> Event.TYPE_HOMEWORK
|
||||||
else -> when (event.getBoolean("Rodzaj")) {
|
else -> when (event.getBoolean("Rodzaj")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user