return M_NOT_YET_UPLOADED when backing files are missing for a thumbnail

This was done for fetching original media files in
c70cfd3d25, but the change for thumbnails
was missed.
This commit is contained in:
Olivia Lee 2024-12-11 15:07:06 -08:00
parent f216112455
commit 795ce42518
No known key found for this signature in database
GPG key ID: 54D568A15B9CD1F9

View file

@ -314,11 +314,7 @@ impl Service {
self.db.search_file_metadata(mxc.clone(), width, height)?
{
debug!("Using saved thumbnail");
let path = services().globals.get_media_file(&key);
let mut file = Vec::new();
File::open(path).await?.read_to_end(&mut file).await?;
return Ok(Some((meta, file.clone())));
return Ok(self.read_content(&key).await?.map(|file| (meta, file)));
}
let Some((meta, key)) =
@ -328,9 +324,10 @@ impl Service {
return Ok(None);
};
let path = services().globals.get_media_file(&key);
let mut file = Vec::new();
File::open(path).await?.read_to_end(&mut file).await?;
let Some(file) = self.read_content(&key).await? else {
debug!("Original image not found, can't generate thumbnail");
return Ok(None);
};
debug!("Generating thumbnail");
let thumbnail_result = {