forked from github/szkolny
[Mobidziennik] Fix extracting when attachment has no size.
This commit is contained in:
parent
a133a96819
commit
f8a7d52b1d
@ -124,7 +124,7 @@ class MobidziennikWebGetMessage(
|
|||||||
val attachmentName = it.ownText()
|
val attachmentName = it.ownText()
|
||||||
Regexes.MOBIDZIENNIK_MESSAGE_ATTACHMENT.find(it.outerHtml())?.let { match ->
|
Regexes.MOBIDZIENNIK_MESSAGE_ATTACHMENT.find(it.outerHtml())?.let { match ->
|
||||||
val attachmentId = match[1].toLong()
|
val attachmentId = match[1].toLong()
|
||||||
var size = match[2].toFloatOrNull() ?: 0f
|
var size = match[2].toFloatOrNull() ?: -1f
|
||||||
when (match[3]) {
|
when (match[3]) {
|
||||||
"K" -> size *= 1024f
|
"K" -> size *= 1024f
|
||||||
"M" -> size *= 1024f * 1024f
|
"M" -> size *= 1024f * 1024f
|
||||||
|
Loading…
x
Reference in New Issue
Block a user