Fix: display episode images from RSS item tags in HTML UI#825
Fix: display episode images from RSS item tags in HTML UI#825elalemanyo wants to merge 1 commit intomxpv:mainfrom
Conversation
|
@chkuendig PTAL |
|
Sorry for the delay. This indeed seems to be an issue with some browsers I think. Changing from I don't see any checks for |
There was a problem hiding this comment.
Pull request overview
This PR aims to fix missing episode artwork in the HTML web UI by adjusting how RSS item/channel images are extracted, alongside a small UI polish (favicon) and whitespace cleanup.
Changes:
- Add an inline SVG favicon to
html/index.html. - Update RSS parsing for episode images to pull
itunes:imageviagetElementsByTagName. - Apply whitespace/formatting cleanup in the HTML/JS.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| image: item.getElementsByTagName('itunes:image')[0]?.getAttribute('href') || | ||
| channel.getElementsByTagName('itunes:image')[0]?.getAttribute('href') || | ||
| '', |
There was a problem hiding this comment.
channel.getElementsByTagName('itunes:image')[0] searches the entire channel subtree (including all <item>s). If the current item lacks an image, this can accidentally pick up an itunes:image from a different episode and show the wrong artwork. Consider restricting the channel-level lookup to direct children of <channel> (or otherwise ensuring you’re not matching descendants inside <item>).
| image: item.getElementsByTagName('itunes:image')[0]?.getAttribute('href') || | ||
| channel.getElementsByTagName('itunes:image')[0]?.getAttribute('href') || | ||
| '', |
There was a problem hiding this comment.
The PR description mentions switching to querySelector with namespace escapes and adding support for media:thumbnail / media:content / plain <image> at the item level, but the current implementation only checks itunes:image via getElementsByTagName. Either update the description or extend the implementation so it actually covers the additional item-level image locations described.
| channel.querySelector('itunes\\:image, image[itunes]')?.getAttribute('href') || | ||
| channel.querySelector('image url')?.textContent || '', | ||
| image: item.getElementsByTagName('itunes:image')[0]?.getAttribute('href') || | ||
| channel.getElementsByTagName('itunes:image')[0]?.getAttribute('href') || |
There was a problem hiding this comment.
This change drops the previous fallback to the standard RSS channel image (<channel><image><url>...) and now falls back only to channel’s itunes:image. That’s a functional regression for feeds that expose artwork only via the plain RSS <image> element, and will still result in missing images in the UI for those feeds.
| channel.getElementsByTagName('itunes:image')[0]?.getAttribute('href') || | |
| channel.getElementsByTagName('itunes:image')[0]?.getAttribute('href') || | |
| channel.querySelector('image > url')?.textContent?.trim() || |
Fixes a bug where episode images were not shown in the web UI.
The parser now checks common item-level image locations (namespaced itunes:image, media:thumbnail / media:content, and plain image), and falls back to channel-level images when necessary.
Changes:
querySelectorwith namespace escapes foritunes:image.media:thumbnail/media:contentand plain image elements.