Kemono: fix missing posts (#1587)

This commit is contained in:
stevenyomi 2024-02-28 15:28:58 +00:00 committed by GitHub
parent b202b87e0c
commit 1156546834
2 changed files with 3 additions and 2 deletions

View File

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

View File

@ -60,7 +60,7 @@ class KemonoPostDto(
if (file.path != null) add(KemonoAttachmentDto(file.name!!, file.path))
addAll(attachments)
}.filter {
when (it.name.substringAfterLast('.').lowercase()) {
when (it.path.substringAfterLast('.').lowercase()) {
"png", "jpg", "gif", "jpeg", "webp" -> true
else -> false
}
@ -91,6 +91,7 @@ class KemonoPostDto(
@Serializable
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"