mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04: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
|
||||
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(),
|
||||
None => None,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user