Skip to content

Conversation

@NicolasNewman
Copy link

The current thumbnail extractor for the RSS widgets fails when its placed in an enclosure. This PR improves the coverage by:

  1. If there is no media extension, check if there's 1 or more Enclosures
  2. For each enclosure:
    1. If the enclosure has type image/generic, save the url
    2. If the enclosure has type "image/jpeg", "image/png", "image/gif", immediately return that URL
  3. If the loop finishes without returning, return the current url (will be the first generic image, or empty string)

Comments:

  • Limited by choosing the first url found. Additional filtering could be added by getting the image dimensions at the cost of fetching each resource.
  • I'm not super familiar with the specification for RSS/Atom so please let me know if theres any potential flaws with this approach.
  • I'm primarily using RSS feeds exported from TTRSS which moves media from the source feed into enclosures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant