mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-31 13:48:20 +01:00
[API/Librus] Fix getting homework without attachments.
This commit is contained in:
parent
b052b5bd66
commit
f5a7799924
@ -26,6 +26,8 @@ class LibrusSynergiaGetHomework(override val data: DataLibrus,
|
|||||||
|
|
||||||
event.attachmentIds = mutableListOf()
|
event.attachmentIds = mutableListOf()
|
||||||
event.attachmentNames = mutableListOf()
|
event.attachmentNames = mutableListOf()
|
||||||
|
|
||||||
|
if (table.size > 6) {
|
||||||
table[6].select("a").forEach { a ->
|
table[6].select("a").forEach { a ->
|
||||||
val attachmentId = a.attr("href").split('/')
|
val attachmentId = a.attr("href").split('/')
|
||||||
.last().toLongOrNull() ?: return@forEach
|
.last().toLongOrNull() ?: return@forEach
|
||||||
@ -33,6 +35,7 @@ class LibrusSynergiaGetHomework(override val data: DataLibrus,
|
|||||||
event.attachmentIds?.add(attachmentId)
|
event.attachmentIds?.add(attachmentId)
|
||||||
event.attachmentNames?.add(filename)
|
event.attachmentNames?.add(filename)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data.eventList.add(event)
|
data.eventList.add(event)
|
||||||
data.eventListReplace = true
|
data.eventListReplace = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user