From f09f069b2ca2e856b98bb88062718510c11354bb Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Wed, 13 May 2020 22:56:22 +0200 Subject: [PATCH] [API/Podlasie] Move event description to homework body. --- .../edziennik/podlasie/data/api/PodlasieApiEvents.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 1a183a84..b98440ea 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 @@ -23,9 +23,8 @@ class PodlasieApiEvents(val data: DataPodlasie, val rows: List) { 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 name = event.getString("Name")?.replace(""", "\"") ?: "" + val description = event.getString("Description")?.replace(""", "\"") ?: "" val type = when (event.getString("Category")?.toLowerCase(Locale.getDefault())) { "klasówka" -> Event.TYPE_EXAM @@ -49,14 +48,16 @@ class PodlasieApiEvents(val data: DataPodlasie, val rows: List) { id = id, date = date, time = time, - topic = topic, + topic = name, color = null, type = type, teacherId = teacher.id, subjectId = lesson?.subjectId ?: -1, teamId = data.teamClass?.id ?: -1, addedDate = addedDate - ) + ).apply { + homeworkBody = description + } data.eventList.add(eventObject) data.metadataList.add(