Check is_image_post flag

pull/4661/head
Kroese 1 month 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 federated_thumbnail
} }
// Generate local thumbnail if allowed // Generate local thumbnail if allowed
else if allow_generate_thumbnail { else if allow_generate_thumbnail && !is_image_post {
match post.url.or(metadata.opengraph_data.image) { 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(), Some(url) => generate_pictrs_thumbnail(&url, &context).await.ok(),
None => None, None => None,
} }

Loading…
Cancel
Save