fix(gallery): forward thumbhash when adding media to gallery

This commit is contained in:
davotoula
2026-05-09 12:03:29 +02:00
parent 86c91a8ddc
commit 3cbc4fcec6
2 changed files with 6 additions and 2 deletions
@@ -961,7 +961,10 @@ fun ShareMediaAction(
// still — the .m3u8 URL itself is a text manifest. Only
// MediaUrlVideo carries an artworkUri.
val posterUrl = (content as? MediaUrlVideo)?.artworkUri
accountViewModel.addMediaToGallery(n19.hex, videoUri, n19.relay.getOrNull(0), blurhash, dim, hash, mimeType, image = posterUrl)
val thumbhashFromContent =
(content as? MediaUrlVideo)?.thumbhash
?: (content as? MediaUrlImage)?.thumbhash
accountViewModel.addMediaToGallery(n19.hex, videoUri, n19.relay.getOrNull(0), blurhash, dim, hash, mimeType, thumbhash = thumbhashFromContent, image = posterUrl)
accountViewModel.toastManager.toast(R.string.media_added, R.string.media_added_to_profile_gallery)
}
}
@@ -896,8 +896,9 @@ class AccountViewModel(
dim: DimensionTag?,
hash: String?,
mimeType: String?,
thumbhash: String? = null,
image: String? = null,
) = launchSigner { account.addToGallery(hex, url, relay, blurhash, dim, hash, mimeType, image = image) }
) = launchSigner { account.addToGallery(hex, url, relay, blurhash, dim, hash, mimeType, thumbhash = thumbhash, image = image) }
fun removeFromMediaGallery(note: Note) = launchSigner { account.removeFromGallery(note) }