mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 13:51:19 +00:00
also consider opengraph image for local thumbnail generation
This commit is contained in:
parent
09bc56bbd2
commit
d0252c3893
1 changed files with 6 additions and 6 deletions
|
@ -103,12 +103,12 @@ pub fn generate_post_link_metadata(
|
||||||
else if federated_thumbnail.is_some() {
|
else if federated_thumbnail.is_some() {
|
||||||
federated_thumbnail
|
federated_thumbnail
|
||||||
}
|
}
|
||||||
// Generate local thumbnail if allowed and post.url is Some
|
// Generate local thumbnail if allowed
|
||||||
else if let (true, Some(url)) = (allow_generate_thumbnail, &post.url) {
|
else if allow_generate_thumbnail {
|
||||||
generate_pictrs_thumbnail(url, &context)
|
match post.url.or(metadata.opengraph_data.image) {
|
||||||
.await
|
Some(url) => generate_pictrs_thumbnail(&url, &context).await.ok(),
|
||||||
.ok()
|
None => None,
|
||||||
.map(Into::into)
|
}
|
||||||
}
|
}
|
||||||
// Otherwise use opengraph preview image directly
|
// Otherwise use opengraph preview image directly
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue