mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 15:39:11 +00:00
Fix broken thumbnails (#4661)
* Check is_image_post flag * Keep cargo_fmt happy * Filter on is_image_post * Trigger CI * Keep cargo_fmt happy
This commit is contained in:
parent
0eaf8d33e7
commit
6b9d9dfaa5
|
@ -105,7 +105,11 @@ pub fn generate_post_link_metadata(
|
||||||
}
|
}
|
||||||
// Generate local thumbnail if allowed
|
// Generate local thumbnail if allowed
|
||||||
else if allow_generate_thumbnail {
|
else if allow_generate_thumbnail {
|
||||||
match post.url.or(metadata.opengraph_data.image) {
|
match post
|
||||||
|
.url
|
||||||
|
.filter(|_| is_image_post)
|
||||||
|
.or(metadata.opengraph_data.image)
|
||||||
|
{
|
||||||
Some(url) => generate_pictrs_thumbnail(&url, &context).await.ok(),
|
Some(url) => generate_pictrs_thumbnail(&url, &context).await.ok(),
|
||||||
None => None,
|
None => None,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue