Filter on is_image_post

pull/4661/head
Kroese 3 weeks ago committed by GitHub
parent 2cebde009d
commit f033389db4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -103,16 +103,9 @@ pub fn generate_post_link_metadata(
else if federated_thumbnail.is_some() {
federated_thumbnail
}
// Generate local thumbnail from metadata if allowed
else if allow_generate_thumbnail && !is_image_post {
match metadata.opengraph_data.image {
Some(url) => generate_pictrs_thumbnail(&url, &context).await.ok(),
None => None,
}
}
// Generate local thumbnail from post url if allowed
else if allow_generate_thumbnail && is_image_post {
match post.url {
// Generate local thumbnail if allowed
else if allow_generate_thumbnail {
match post.url.filter(|_| is_image_post).or(metadata.opengraph_data.image) {
Some(url) => generate_pictrs_thumbnail(&url, &context).await.ok(),
None => None,
}

Loading…
Cancel
Save