[API/Podlasie] Fix encoding in events topic.

This commit is contained in:
Kacper Ziubryniewicz 2020-05-13 22:49:01 +02:00
parent 795317f13f
commit 65ba330d5f

View File

@ -22,8 +22,10 @@ class PodlasieApiEvents(val data: DataPodlasie, val rows: List<JsonObject>) {
val date = event.getString("DateFrom")?.let { Date.fromY_m_d(it) } ?: return@forEach val date = event.getString("DateFrom")?.let { Date.fromY_m_d(it) } ?: return@forEach
val time = event.getString("DateFrom")?.let { Time.fromY_m_d_H_m_s(it) } val time = event.getString("DateFrom")?.let { Time.fromY_m_d_H_m_s(it) }
?: return@forEach ?: return@forEach
val name = event.getString("Name") ?: "" val name = event.getString("Name") ?: ""
val description = event.getString("Description") ?: "" val description = event.getString("Description") ?: ""
val topic = "$name\n\n$description".replace("&#34;", "\"")
val type = when (event.getString("Category")?.toLowerCase(Locale.getDefault())) { val type = when (event.getString("Category")?.toLowerCase(Locale.getDefault())) {
"klasówka" -> Event.TYPE_EXAM "klasówka" -> Event.TYPE_EXAM
@ -47,7 +49,7 @@ class PodlasieApiEvents(val data: DataPodlasie, val rows: List<JsonObject>) {
id = id, id = id,
date = date, date = date,
time = time, time = time,
topic = "$name\n\n$description", topic = topic,
color = null, color = null,
type = type, type = type,
teacherId = teacher.id, teacherId = teacher.id,