Simplifies the drawing of gallery entires without e tags.

This commit is contained in:
Vitor Pamplona
2024-07-31 16:02:18 -04:00
parent 42ceb0c404
commit 3bbb780d2b
3 changed files with 52 additions and 40 deletions

View File

@@ -58,9 +58,9 @@ class ProfileGalleryEntryEvent(
fun hasUrl() = tags.any { it.size > 1 && it[0] == URL }
fun event() = tags.firstOrNull { it.size > 1 && it[0] == "e" }?.get(1)
fun fromEvent() = tags.firstOrNull { it.size > 1 && it[0] == "e" }?.get(1)
fun hasEvent() = tags.any { it.size > 1 && it[0] == "e" }
fun hasFromEvent() = tags.any { it.size > 1 && it[0] == "e" }
fun isOneOf(mimeTypes: Set<String>) = tags.any { it.size > 1 && it[0] == MIME_TYPE && mimeTypes.contains(it[1]) }