[Mobidziennik/Web] Fix counting e-attendance.

This commit is contained in:
Kuba Szczodrzyński 2021-02-26 23:04:25 +01:00
parent e825af0ff0
commit 74820fe67d

View File

@ -188,23 +188,19 @@ class MobidziennikWebAttendance(override val data: DataMobidziennik,
} }
entry = entry.removePrefix(typeSymbol) entry = entry.removePrefix(typeSymbol)
var isCounted = true val isCounted = true
val baseType = when (typeSymbol) { val baseType = when (typeSymbol) {
"." -> TYPE_PRESENT "." -> TYPE_PRESENT
"|" -> TYPE_ABSENT "|" -> TYPE_ABSENT
"+" -> TYPE_ABSENT_EXCUSED "+" -> TYPE_ABSENT_EXCUSED
"s" -> TYPE_BELATED "s" -> TYPE_BELATED
"z" -> TYPE_RELEASED "z" -> TYPE_RELEASED
else -> {
isCounted = false
when (typeSymbol) {
"e" -> TYPE_PRESENT_CUSTOM "e" -> TYPE_PRESENT_CUSTOM
"en" -> TYPE_ABSENT "en" -> TYPE_ABSENT
"ep" -> TYPE_PRESENT_CUSTOM "ep" -> TYPE_PRESENT_CUSTOM
"+ₑ" -> TYPE_ABSENT_EXCUSED
else -> TYPE_UNKNOWN else -> TYPE_UNKNOWN
} }
}
}
val typeName = types?.get(typeSymbol) ?: "" val typeName = types?.get(typeSymbol) ?: ""
val typeColor = when (typeSymbol) { val typeColor = when (typeSymbol) {
"e" -> 0xff673ab7 "e" -> 0xff673ab7