Skip to content

Add artist artwork display for radio streams#3110

Open
OzGav wants to merge 7 commits intodevfrom
radio-artist-artwork
Open

Add artist artwork display for radio streams#3110
OzGav wants to merge 7 commits intodevfrom
radio-artist-artwork

Conversation

@OzGav
Copy link
Copy Markdown
Contributor

@OzGav OzGav commented Feb 7, 2026

With all the UI improvements I thought it would be good to enhance radio stations to rather than just show the station logo but instead show the current single cover/album/artist. This PR allows for the display of thumbnail images for radio streams when track metadata (Artist - Title) is available.

How it works:

  • Parses "Artist - Title" from ICY/HLS stream metadata
  • Checks user's library first for matching tracks/artists (fast, no API calls, respects user-curated images)
  • Uses MusicBrainz recording search to verify artist + track for external lookups
  • Tries single artwork first (exact track art), then falls back to album artwork via TheAudioDB/Fanart.tv
  • Falls back to artist artwork lookup via TheAudioDB/Fanart.tv
  • If no artwork found, uses the station logo as fallback
  • Results cached (90 days hits, 7 days misses) to minimize API calls

Release group matching: Aggregates release groups from all matching MusicBrainz recordings and sorts by release date. Singles are tried first (for exact track artwork), then albums. Compilations and live albums are filtered out.

Title cleaning: Strips version suffixes (remastered, live, etc.) and featuring credits from track names to improve MusicBrainz matching.

Edge cases handled:

  • Name format variations: Squier, Billy → Billy Squier, Bon_Jovi → Bon Jovi
  • Swapped metadata: Detects stations sending "Track - Artist" instead of "Artist - Track"
  • "The" prefix: Tries searches with and without leading "The " for artist names
  • Diacritics: Blue Öyster Cult matches Blue Oyster Cult
  • Collaborations: Artist1 feat. Artist2 extracts primary artist only
  • Advertisements: Detects ad markers and shows station logo instead

@marcelveldt marcelveldt marked this pull request as draft February 8, 2026 18:53
@OzGav OzGav marked this pull request as ready for review February 9, 2026 04:23
@OzGav OzGav marked this pull request as draft February 9, 2026 05:26
@OzGav
Copy link
Copy Markdown
Contributor Author

OzGav commented Feb 9, 2026

Since we are trying to lookup on musicbrainz it is important clean artist and tracks names are sent. New functions added to support this.

@OzGav
Copy link
Copy Markdown
Contributor Author

OzGav commented Feb 9, 2026

Also I know some comments need to be tidied up or removed just wanted to keep my thought patterns there for now.

@OzGav OzGav marked this pull request as ready for review February 9, 2026 07:01
@OzGav OzGav requested a review from marcelveldt February 11, 2026 01:40
@marcelveldt-traveling
Copy link
Copy Markdown
Contributor

I think we should always prefer the track metadata over anything else.
We should try to fetch artwork/metadata in this order:

  1. Try to get metadata of the actual recording/track (some popular tracks actually have track-level metadata!)
  2. Fallback to single match (so album name is exactly the same as clean track name)
  3. Fallback to first album that is NOT a compilation
  4. Fallback to artist artwork

Also, I don't particular like the fact that this PR is duplicating logic, reinventing the wheel. Better improve existing logic instead of creating sidepaths that do more or less the same.

Then finally, we should aim at improving the lookup and metadata retrieval methods in the musicbrainz controller in a dedicated PR, not mangled into a PR that wants to fetch metadata for a radio stream.

Note that we can actually fetch images from MusicBrainz too using the coverart archive.

@OzGav
Copy link
Copy Markdown
Contributor Author

OzGav commented Mar 13, 2026

Try to get metadata of the actual recording/track

This is not possible with MB or the Cover Art Archive as the endpoints are at the release level not recording. https://community.metabrainz.org/t/how-to-get-search-cover-image-of-track/337917/3

There is equally no way to query a track at TheAudioDB or Fanart.tv. MA, of course, does store images at track level and that is already the first thing I look for.

So your priortiy order is already how it works except for the single image as the second option so I have added that.

I have also created a PR just with the musicbrainz changes and marked this as draft until that is merged.

@OzGav OzGav marked this pull request as draft March 13, 2026 14:57
@OzGav OzGav added this to the 2.8.0 milestone Mar 15, 2026
@kieranhogg
Copy link
Copy Markdown
Contributor

I appreciate it's an outlier, but just checking if there is a way to 'opt-out' of this feature when this functionality is already present in a provider as it is in the BBC Sounds one?

@OzGav
Copy link
Copy Markdown
Contributor Author

OzGav commented Mar 16, 2026

Since we made that change with the callback it should be fine I think?

@kieranhogg
Copy link
Copy Markdown
Contributor

Ah, I didn't even make the connection somehow! Strangely, one Sounds endpoint is missing track images, so I might well look at using these helpers as well, once it's landed.

@OzGav OzGav modified the milestones: 2.8.0, 2.9.0 Mar 16, 2026
@OzGav OzGav marked this pull request as ready for review March 29, 2026 12:02
@OzGav OzGav closed this Mar 31, 2026
@OzGav OzGav force-pushed the radio-artist-artwork branch from 4c15b8a to c990c43 Compare March 31, 2026 16:22
@OzGav OzGav reopened this Mar 31, 2026
@OzGav OzGav marked this pull request as draft March 31, 2026 16:36
@OzGav OzGav marked this pull request as ready for review April 1, 2026 00:57
@marcelveldt marcelveldt marked this pull request as draft April 2, 2026 21:03
@OzGav OzGav force-pushed the radio-artist-artwork branch from 3af3d1d to d06751d Compare April 6, 2026 03:46
@OzGav OzGav marked this pull request as ready for review April 6, 2026 05:56
@OzGav OzGav requested a review from marcelveldt April 11, 2026 22:06
OzGav and others added 7 commits April 14, 2026 00:13
Looks up artist/track artwork for radio streams using ICY and HLS metadata.
Uses MusicBrainz to find release groups, then queries fanart.tv and TheAudioDB
for artwork. Prefers single artwork first, falls back to album, then artist.

Includes artist name normalization for radio metadata (handles "Last, First"
format, business suffixes, known band names), swap detection for stations
that send "Track - Artist" format, and "The " prefix handling for searches.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@OzGav OzGav force-pushed the radio-artist-artwork branch from f16f141 to d1e8c62 Compare April 13, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants