mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-11-24 19:04:38 -06:00
[API/Mobidziennik] Fix homework attachment downloading.
This commit is contained in:
parent
041bfc6cc0
commit
238250e8c9
@ -97,7 +97,7 @@ object Regexes {
|
||||
"""zadanieFormularz\(([0-9]+),""".toRegex(DOT_MATCHES_ALL)
|
||||
}
|
||||
val MOBIDZIENNIK_HOMEWORK_ATTACHMENT by lazy {
|
||||
"""zalacznik=([0-9]+)'.+?word-break">(.+?)</td>""".toRegex(DOT_MATCHES_ALL)
|
||||
"""zalacznik(_zadania)?=([0-9]+)'.+?word-break">(.+?)</td>""".toRegex(DOT_MATCHES_ALL)
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,14 +29,14 @@ class MobidziennikWebGetAttachment(override val data: DataMobidziennik,
|
||||
|
||||
val typeUrl = when (owner) {
|
||||
is Message -> if (owner.type == Message.TYPE_SENT)
|
||||
"dziennik/wiadwyslana?id="
|
||||
"dziennik/wiadwyslana/?id="
|
||||
else
|
||||
"dziennik/wiadodebrana?id="
|
||||
"dziennik/wiadodebrana/?id="
|
||||
|
||||
is Event -> if (owner.date >= Date.getToday())
|
||||
"mobile/zadaniadomowe?id_zadania="
|
||||
"dziennik/zadaniedomowe/?id_zadania="
|
||||
else
|
||||
"mobile/zadaniadomowearchiwalne?id_zadania="
|
||||
"dziennik/zadaniedomowe/?id_zadania="
|
||||
|
||||
else -> ""
|
||||
}
|
||||
@ -47,7 +47,7 @@ class MobidziennikWebGetAttachment(override val data: DataMobidziennik,
|
||||
else -> -1
|
||||
}
|
||||
|
||||
webGetFile(TAG, "/$typeUrl${ownerId}&zalacznik=$attachmentId", targetFile, { file ->
|
||||
webGetFile(TAG, "/$typeUrl${ownerId}&uczen=${data.studentId}&zalacznik=$attachmentId", targetFile, { file ->
|
||||
|
||||
val event = AttachmentGetEvent(
|
||||
profileId,
|
||||
|
Loading…
Reference in New Issue
Block a user