From d5622a65f813c000e12b45a475e1855685348a38 Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 10 Apr 2024 16:09:54 +0200 Subject: [PATCH] Fix for PictrsImageMode::None (#4604) * Fix PictrsImageMode::None * Update crates/api_common/src/request.rs Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com> * Fix formatting --------- Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com> --- crates/api_common/src/request.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/api_common/src/request.rs b/crates/api_common/src/request.rs index d77ea2daa..06410b70c 100644 --- a/crates/api_common/src/request.rs +++ b/crates/api_common/src/request.rs @@ -302,9 +302,13 @@ async fn generate_pictrs_thumbnail( ) -> Result { let pictrs_config = context.settings().pictrs_config()?; - 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