Skip to content

Fix: display episode images from RSS item tags in HTML UI#825

Open
elalemanyo wants to merge 1 commit intomxpv:mainfrom
elalemanyo:fix/web_display_episode_images
Open

Fix: display episode images from RSS item tags in HTML UI#825
elalemanyo wants to merge 1 commit intomxpv:mainfrom
elalemanyo:fix/web_display_episode_images

Conversation

@elalemanyo
Copy link
Contributor

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:

  • Use querySelector with namespace escapes for itunes:image.
  • Add checks for media:thumbnail / media:content and plain image elements.
  • Add basic favicon
  • Remove some spaces 🙈

@mxpv
Copy link
Owner

mxpv commented Feb 14, 2026

@chkuendig PTAL

@chkuendig
Copy link
Contributor

Sorry for the delay. This indeed seems to be an issue with some browsers I think. Changing from querySelector to getElementsByTagName is the correct way of doing things.

I don't see any checks for media:thumbnail and media:content though? Maybe i missed them, generally this would be much easier to review if the 4 changes were their own commit, especially the whitespace/formatting change.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:image via getElementsByTagName.
  • Apply whitespace/formatting cleanup in the HTML/JS.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +510 to +512
image: item.getElementsByTagName('itunes:image')[0]?.getAttribute('href') ||
channel.getElementsByTagName('itunes:image')[0]?.getAttribute('href') ||
'',
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>).

Copilot uses AI. Check for mistakes.
Comment on lines +510 to +512
image: item.getElementsByTagName('itunes:image')[0]?.getAttribute('href') ||
channel.getElementsByTagName('itunes:image')[0]?.getAttribute('href') ||
'',
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
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') ||
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
channel.getElementsByTagName('itunes:image')[0]?.getAttribute('href') ||
channel.getElementsByTagName('itunes:image')[0]?.getAttribute('href') ||
channel.querySelector('image > url')?.textContent?.trim() ||

Copilot uses AI. Check for mistakes.
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.

4 participants