Improving the detection of image types on the Media Feed.

This commit is contained in:
Vitor Pamplona
2024-06-04 16:38:31 -04:00
parent 807af3b613
commit 1bf8165641
2 changed files with 2 additions and 2 deletions

View File

@@ -50,7 +50,7 @@ fun FileHeaderDisplay(
val hash = event.hash()
val dimensions = event.dimensions()
val description = event.content.ifEmpty { null } ?: event.alt()
val isImage = RichTextParser.isImageUrl(fullUrl)
val isImage = event.mimeType()?.startsWith("image/") == true || RichTextParser.isImageUrl(fullUrl)
val uri = note.toNostrUri()
mutableStateOf<BaseMediaContent>(

View File

@@ -85,7 +85,7 @@ fun VideoDisplay(
val hash = event.hash()
val dimensions = event.dimensions()
val description = event.content.ifBlank { null } ?: event.alt()
val isImage = RichTextParser.isImageUrl(fullUrl)
val isImage = event.mimeType()?.startsWith("image/") == true || RichTextParser.isImageUrl(fullUrl)
val uri = note.toNostrUri()
mutableStateOf<BaseMediaContent>(