fix(gallery): forward thumbhash when adding media to gallery
This commit is contained in:
+4
-1
@@ -961,7 +961,10 @@ fun ShareMediaAction(
|
|||||||
// still — the .m3u8 URL itself is a text manifest. Only
|
// still — the .m3u8 URL itself is a text manifest. Only
|
||||||
// MediaUrlVideo carries an artworkUri.
|
// MediaUrlVideo carries an artworkUri.
|
||||||
val posterUrl = (content as? MediaUrlVideo)?.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)
|
accountViewModel.toastManager.toast(R.string.media_added, R.string.media_added_to_profile_gallery)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -896,8 +896,9 @@ class AccountViewModel(
|
|||||||
dim: DimensionTag?,
|
dim: DimensionTag?,
|
||||||
hash: String?,
|
hash: String?,
|
||||||
mimeType: String?,
|
mimeType: String?,
|
||||||
|
thumbhash: String? = null,
|
||||||
image: 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) }
|
fun removeFromMediaGallery(note: Note) = launchSigner { account.removeFromGallery(note) }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user