mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-25 22:10:20 +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
1 changed files with 5 additions and 1 deletions
|
@ -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 a new issue