From 65ba330d5f0124e8a787c3ba8a7f30bc131b328f Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Wed, 13 May 2020 22:49:01 +0200 Subject: [PATCH] [API/Podlasie] Fix encoding in events topic. --- .../data/api/edziennik/podlasie/data/api/PodlasieApiEvents.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/podlasie/data/api/PodlasieApiEvents.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/podlasie/data/api/PodlasieApiEvents.kt index e4dac6cc..1a183a84 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/podlasie/data/api/PodlasieApiEvents.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/podlasie/data/api/PodlasieApiEvents.kt @@ -22,8 +22,10 @@ class PodlasieApiEvents(val data: DataPodlasie, val rows: List) { 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) } ?: return@forEach + val name = event.getString("Name") ?: "" val description = event.getString("Description") ?: "" + val topic = "$name\n\n$description".replace(""", "\"") val type = when (event.getString("Category")?.toLowerCase(Locale.getDefault())) { "klasówka" -> Event.TYPE_EXAM @@ -47,7 +49,7 @@ class PodlasieApiEvents(val data: DataPodlasie, val rows: List) { id = id, date = date, time = time, - topic = "$name\n\n$description", + topic = topic, color = null, type = type, teacherId = teacher.id,