Update crates/api_common/src/request.rs

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
pull/4604/head
Kroese 2 months ago committed by GitHub
parent caeb44c9db
commit 8571ce23c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -302,13 +302,11 @@ async fn generate_pictrs_thumbnail(
) -> Result<Url, LemmyError> {
let pictrs_config = context.settings().pictrs_config()?;
if pictrs_config.image_mode() == PictrsImageMode::None {
return Ok(image_url.clone());
}
if pictrs_config.image_mode() == PictrsImageMode::ProxyAllImages {
return Ok(proxy_image_link(image_url.clone(), context).await?.into());
}
match pictrs_config.image_mode() {
PictrsImageMode::None => return Ok(image_url.clone()),
PictrsImageMode::ProxyAllImages => return Ok(proxy_image_link(image_url.clone(), context).await?.into()),
_ => {}
};
// fetch remote non-pictrs images for persistent thumbnail link
// TODO: should limit size once supported by pictrs

Loading…
Cancel
Save