mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-10 06:54:12 +00:00
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>
This commit is contained in:
parent
9059de8569
commit
d5622a65f8
1 changed files with 7 additions and 3 deletions
|
@ -302,9 +302,13 @@ async fn generate_pictrs_thumbnail(
|
||||||
) -> Result<Url, LemmyError> {
|
) -> Result<Url, LemmyError> {
|
||||||
let pictrs_config = context.settings().pictrs_config()?;
|
let pictrs_config = context.settings().pictrs_config()?;
|
||||||
|
|
||||||
if pictrs_config.image_mode() == PictrsImageMode::ProxyAllImages {
|
match pictrs_config.image_mode() {
|
||||||
return Ok(proxy_image_link(image_url.clone(), context).await?.into());
|
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
|
// fetch remote non-pictrs images for persistent thumbnail link
|
||||||
// TODO: should limit size once supported by pictrs
|
// TODO: should limit size once supported by pictrs
|
||||||
|
|
Loading…
Reference in a new issue