Fixed zim file size issue in library section

This commit is contained in:
MohitMali 2023-07-17 11:06:29 +05:30 committed by Kelson
parent 3e59e97af1
commit a1ee8bec25

View File

@ -92,7 +92,11 @@ class ZimFileReader constructor(
null
}
val id: String get() = jniKiwixReader.uuid
val fileSize: Long get() = jniKiwixReader.filesize
/*
libzim returns file size in kib so we need to convert it into bytes.
More information here https://github.com/kiwix/java-libkiwix/issues/41
*/
val fileSize: Long get() = jniKiwixReader.filesize / 1024
val creator: String get() = jniKiwixReader.getMetadata("Creator")
val publisher: String get() = jniKiwixReader.getMetadata("Publisher")
val name: String get() = jniKiwixReader.getMetadata("Name")?.takeIf(String::isNotEmpty) ?: id