Kemono | Fixed some chapters/images not loading due to missing 'name' (#6443)

Fixed some chapters/images not loading due to missing 'name'
This commit is contained in:
KenjieDec 2024-12-03 20:34:58 +07:00 committed by Draff
parent 0d1ac7b51e
commit 5f9d4e1dc6
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 4 additions and 4 deletions

View File

@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}
baseVersionCode = 15
baseVersionCode = 16

View File

@ -70,7 +70,7 @@ class KemonoPostDto(
) {
val images: List<String>
get() = buildList(attachments.size + 1) {
if (file.path != null) add(KemonoAttachmentDto(file.name!!, file.path))
if (file.path != null) add(KemonoAttachmentDto(file.name, file.path))
addAll(attachments)
}.filter {
when (it.path.substringAfterLast('.').lowercase()) {
@ -106,8 +106,8 @@ class KemonoFileDto(val name: String? = null, val path: String? = null)
// name might have ".jpe" extension for JPEG, path might have ".m4v" extension for MP4
@Serializable
class KemonoAttachmentDto(val name: String, val path: String) {
override fun toString() = "$path?f=$name"
class KemonoAttachmentDto(var name: String? = null, val path: String) {
override fun toString() = path + if (name != null) "?f=$name" else ""
}
private fun getApiDateFormat() =