mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 21:06:44 -06:00
[API/Librus] Add online lesson URL to events description.
This commit is contained in:
parent
90e99e241a
commit
85106a01d7
@ -35,7 +35,7 @@ class LibrusApiEvents(override val data: DataLibrus,
|
|||||||
events?.forEach { event ->
|
events?.forEach { event ->
|
||||||
val id = event.getLong("Id") ?: return@forEach
|
val id = event.getLong("Id") ?: return@forEach
|
||||||
val eventDate = Date.fromY_m_d(event.getString("Date"))
|
val eventDate = Date.fromY_m_d(event.getString("Date"))
|
||||||
val topic = event.getString("Content")?.trim() ?: ""
|
var topic = event.getString("Content")?.trim() ?: ""
|
||||||
val type = event.getJsonObject("Category")?.getLong("Id") ?: -1
|
val type = event.getJsonObject("Category")?.getLong("Id") ?: -1
|
||||||
val teacherId = event.getJsonObject("CreatedBy")?.getLong("Id") ?: -1
|
val teacherId = event.getJsonObject("CreatedBy")?.getLong("Id") ?: -1
|
||||||
val subjectId = event.getJsonObject("Subject")?.getLong("Id") ?: -1
|
val subjectId = event.getJsonObject("Subject")?.getLong("Id") ?: -1
|
||||||
@ -46,6 +46,12 @@ class LibrusApiEvents(override val data: DataLibrus,
|
|||||||
val startTime = lessonRange?.startTime ?: Time.fromH_m(event.getString("TimeFrom"))
|
val startTime = lessonRange?.startTime ?: Time.fromH_m(event.getString("TimeFrom"))
|
||||||
val addedDate = Date.fromIso(event.getString("AddDate"))
|
val addedDate = Date.fromIso(event.getString("AddDate"))
|
||||||
|
|
||||||
|
event.getJsonObject("onlineLessonUrl")?.let { onlineLesson ->
|
||||||
|
val text = onlineLesson.getString("text")?.let { "$it - " } ?: ""
|
||||||
|
val url = onlineLesson.getString("url")
|
||||||
|
topic += "\n\n$text$url"
|
||||||
|
}
|
||||||
|
|
||||||
val eventObject = Event(
|
val eventObject = Event(
|
||||||
profileId = profileId,
|
profileId = profileId,
|
||||||
id = id,
|
id = id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user