Skip to content

Commit

Permalink
Fix for PictrsImageMode::None (#4604)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
kroese and SleeplessOne1917 committed Apr 10, 2024
1 parent 9059de8 commit d5622a6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/api_common/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,13 @@ async fn generate_pictrs_thumbnail(
) -> Result<Url, LemmyError> {
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
Expand Down

0 comments on commit d5622a6

Please sign in to comment.