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:
parent
0d1ac7b51e
commit
5f9d4e1dc6
|
@ -2,4 +2,4 @@ plugins {
|
||||||
id("lib-multisrc")
|
id("lib-multisrc")
|
||||||
}
|
}
|
||||||
|
|
||||||
baseVersionCode = 15
|
baseVersionCode = 16
|
||||||
|
|
|
@ -70,7 +70,7 @@ class KemonoPostDto(
|
||||||
) {
|
) {
|
||||||
val images: List<String>
|
val images: List<String>
|
||||||
get() = buildList(attachments.size + 1) {
|
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)
|
addAll(attachments)
|
||||||
}.filter {
|
}.filter {
|
||||||
when (it.path.substringAfterLast('.').lowercase()) {
|
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
|
// name might have ".jpe" extension for JPEG, path might have ".m4v" extension for MP4
|
||||||
@Serializable
|
@Serializable
|
||||||
class KemonoAttachmentDto(val name: String, val path: String) {
|
class KemonoAttachmentDto(var name: String? = null, val path: String) {
|
||||||
override fun toString() = "$path?f=$name"
|
override fun toString() = path + if (name != null) "?f=$name" else ""
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getApiDateFormat() =
|
private fun getApiDateFormat() =
|
||||||
|
|
Loading…
Reference in New Issue