fixed summary card thumbnail size

This commit is contained in:
Mariotaku Lee 2018-05-26 01:37:23 +08:00
parent d2b3cf7c98
commit 2aad4ebc63
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
1 changed files with 1 additions and 1 deletions

View File

@ -335,7 +335,7 @@ private fun CardEntity.toSummaryCard(thumbnailSize: Int): SummaryCard? {
return@mapNotNull v as? CardEntity.ImageValue
}.sortedBy { Math.min(it.width, it.height) }
val bestThumbnail = thumbnails.firstOrNull {
thumbnailSize >= Math.min(it.width, it.height)
Math.min(it.width, it.height) >= thumbnailSize
} ?: thumbnails.lastOrNull()
obj.thumbnail = bestThumbnail?.url
return obj