LemmyNet/lemmy

[Bug]: Thumbnails still broken

kroese opened this issue · 0 comments

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Do you agree to follow the rules in our Code of Conduct?
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

I can't count the number of revisions the thumbnail generation code already went through by now, but somehow it is still broken in 0.19.4-beta.4.

What happens is that posts get their thumbnail url set to the link url, even if that link is not an image. This results in most posts showing up with broken images, since the browser expects an image url.

I think the offending line is here:

match post.url.or(metadata.opengraph_data.image) {

The problem with that line is that it doesnt check if the post.url is an image. It should check the is_image_post boolean to verify if post.url qualifies to be used.

Version

BE 0.19.4-beta.4