[API/Mobidziennik] Fix some errors.

This commit is contained in:
Kuba Szczodrzyński 2020-03-27 14:05:03 +01:00
parent 30b6ac2a06
commit 0b1e7242bb
2 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@
package pl.szczodrzynski.edziennik.data.api.edziennik.mobidziennik.data.api
import android.text.Html
import androidx.core.util.contains
import pl.szczodrzynski.edziennik.data.api.edziennik.mobidziennik.DataMobidziennik
import pl.szczodrzynski.edziennik.data.api.models.DataRemoveModel
@ -25,7 +26,7 @@ class MobidziennikApiHomework(val data: DataMobidziennik, rows: List<String>) {
val id = cols[0].toLong()
val teacherId = cols[7].toLong()
val subjectId = cols[6].toLong()
val topic = cols[1]
val topic = Html.fromHtml(cols[1])?.toString() ?: ""
val eventDate = Date.fromYmd(cols[2])
val startTime = Time.fromYmdHm(cols[3])

View File

@ -44,7 +44,7 @@ class MobidziennikApiTeams(val data: DataMobidziennik, tableTeams: List<String>?
val studentId = cols[1].toInt()
val teamId = cols[2].toLong()
val studentNumber = cols[4].toInt()
val studentNumber = cols[4].toIntOrNull() ?: -1
if (studentId != data.studentId)
continue