Check is_image_post flag

pull/4661/head
Kroese 3 weeks ago committed by GitHub
parent 0eaf8d33e7
commit 5e5b5dd8cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -104,8 +104,14 @@ pub fn generate_post_link_metadata(
federated_thumbnail
}
// Generate local thumbnail if allowed
else if allow_generate_thumbnail {
match post.url.or(metadata.opengraph_data.image) {
else if allow_generate_thumbnail && !is_image_post {
match metadata.opengraph_data.image {
Some(url) => generate_pictrs_thumbnail(&url, &context).await.ok(),
None => None,
}
}
else if allow_generate_thumbnail && is_image_post {
match post.url {
Some(url) => generate_pictrs_thumbnail(&url, &context).await.ok(),
None => None,
}

Loading…
Cancel
Save