Fixes content title for the video playback notification

This commit is contained in:
Vitor Pamplona
2024-03-02 16:11:01 -05:00
parent a301421915
commit 4fb68dd014
4 changed files with 12 additions and 6 deletions
@@ -497,7 +497,11 @@ private fun RenderContentAsMarkdown(
ZoomableContentView(
content =
remember(destination, tags) {
RichTextParser().parseMediaUrl(destination, tags ?: EmptyTagList) ?: MediaUrlImage(url = destination)
RichTextParser().parseMediaUrl(
destination,
tags ?: EmptyTagList,
title.ifEmpty { null } ?: content,
) ?: MediaUrlImage(url = destination, description = title.ifEmpty { null } ?: content)
},
roundedCorner = true,
accountViewModel = accountViewModel,
@@ -3575,7 +3575,7 @@ fun FileHeaderDisplay(
val blurHash = event.blurhash()
val hash = event.hash()
val dimensions = event.dimensions()
val description = event.alt() ?: event.content
val description = event.content.ifEmpty { null } ?: event.alt()
val isImage = RichTextParser.isImageUrl(fullUrl)
val uri = note.toNostrUri()
@@ -3634,7 +3634,7 @@ fun VideoDisplay(
val blurHash = event.blurhash()
val hash = event.hash()
val dimensions = event.dimensions()
val description = event.alt() ?: event.content
val description = event.content.ifBlank { null } ?: event.alt()
val isImage = RichTextParser.isImageUrl(fullUrl)
val uri = note.toNostrUri()