diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt index 64889c829..6666d7d19 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt @@ -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) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt index af02c9f5d..a45ab3186 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt @@ -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) }