mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-01-07 10:42:19 +00:00
Fixing an issue with pictrs errors
This commit is contained in:
parent
8db37baf93
commit
736614d633
1 changed files with 9 additions and 3 deletions
|
@ -163,15 +163,21 @@ pub async fn fetch_site_metadata_and_pictrs_data(
|
|||
let pictrs_hash = match &metadata_option {
|
||||
Some(metadata_res) => match &metadata_res.image {
|
||||
Some(metadata_image) => fetch_pictrs(client, metadata_image)
|
||||
.await?
|
||||
.await
|
||||
// Ignore the error, just return None
|
||||
.unwrap_or(None)
|
||||
.map(|r| r.files[0].file.to_owned()),
|
||||
// Try to generate a small thumbnail if there's a full sized one from post-links
|
||||
None => fetch_pictrs(client, url)
|
||||
.await?
|
||||
.await
|
||||
// Ignore the error, just return None
|
||||
.unwrap_or(None)
|
||||
.map(|r| r.files[0].file.to_owned()),
|
||||
},
|
||||
None => fetch_pictrs(client, url)
|
||||
.await?
|
||||
.await
|
||||
// Ignore the error, just return None
|
||||
.unwrap_or(None)
|
||||
.map(|r| r.files[0].file.to_owned()),
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue