chore(send queue): save the thumbnail as the thumbnail of itself
This commit is contained in:
@@ -574,7 +574,7 @@ async fn test_send_media_with_thumbnail() -> TestResult {
|
||||
.media()
|
||||
.get_media_content(
|
||||
&MediaRequestParameters {
|
||||
source: content.source.clone(),
|
||||
source: MediaSource::Plain(thumbnail_uri.clone()),
|
||||
format: MediaFormat::Thumbnail(MediaThumbnailSettings::new(
|
||||
uint!(37),
|
||||
uint!(13),
|
||||
|
||||
@@ -978,11 +978,12 @@ async fn update_media_cache_keys_after_upload(
|
||||
.await
|
||||
{
|
||||
Ok(Some(thumbnail_content)) => {
|
||||
// Cache this as a thumbnail for the original source, in the media store.
|
||||
// Also cache this as a thumbnail for the thumbnail, in the media store; the
|
||||
// ElementX apps expect that specific format for thumbnails.
|
||||
media_store
|
||||
.add_media_content(
|
||||
&MediaRequestParameters {
|
||||
source: sent_media.file.clone(),
|
||||
source: remote_thumbnail_source.clone(),
|
||||
format: MediaFormat::Thumbnail(MediaThumbnailSettings::new(
|
||||
width, height,
|
||||
)),
|
||||
|
||||
@@ -2148,13 +2148,13 @@ async fn test_media_uploads() {
|
||||
.expect("media should be found");
|
||||
assert_eq!(thumbnail_media_as_file, b"thumbnail");
|
||||
|
||||
// The thumbnail can be retrieved as a thumbnail of the original media, using
|
||||
// The thumbnail can be retrieved as a thumbnail of itself, using
|
||||
// the sent media MXC URI:
|
||||
let thumbnail_media_as_thumbnail = client
|
||||
.media()
|
||||
.get_media_content(
|
||||
&MediaRequestParameters {
|
||||
source: new_content.source,
|
||||
source: new_thumbnail_source.clone(),
|
||||
format: MediaFormat::Thumbnail(MediaThumbnailSettings::new(uint!(37), uint!(13))),
|
||||
},
|
||||
true,
|
||||
|
||||
Reference in New Issue
Block a user