mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-09-27 14:00:17 +00:00
Filter on is_image_post
This commit is contained in:
parent
2cebde009d
commit
f033389db4
1 changed files with 3 additions and 10 deletions
|
@ -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…
Reference in a new issue