Skip to content

fix: only swap YTM thumbnail for music videos, not audio tracks#949

Merged
rukamori merged 2 commits into
ArchiveTuneApp:devfrom
sang765:fix/thumbnail-swap-music-video-only
Jun 30, 2026
Merged

fix: only swap YTM thumbnail for music videos, not audio tracks#949
rukamori merged 2 commits into
ArchiveTuneApp:devfrom
sang765:fix/thumbnail-swap-music-video-only

Conversation

@sang765

@sang765 sang765 commented Jun 30, 2026

Copy link
Copy Markdown
Member

The rememberThumbnailSwapState composable was attempting to load YT i.ytimg.com thumbnails for every item with a non-null videoId, regardless of whether it was a music video or an audio track. This caused "Music" type items (1:1 YTM art) to silently get their thumbnail swapped to YT lower-quality video thumbnails.

The static isMusicVideo flag from musicVideoType (OMV/UGC) misses some video items. This fix adds a runtime check using Media3 Player.getTracks() to detect actual video tracks at playback time.

Changes:

  • Added hasVideoTracks StateFlow to PlayerConnection, initialized from player.tracks and updated on onTracksChanged
  • Updated rememberThumbnailSwapState to accept hasVideoTracks: Boolean and use isMusicVideo || hasVideoTracks
  • Updated all 9 call sites to pass hasVideoTracks from playerConnection

The shouldAttemptYT flag now requires videoId != null && !lowDataMode && (isMusicVideo || hasVideoTracks) — the runtime thumbnail swap fires only when the item is statically flagged as a music video OR the Media3 player reports active video tracks.

@sang765 sang765 self-assigned this Jun 30, 2026
@sang765 sang765 added the BUG Something isn't working label Jun 30, 2026
@sang765 sang765 marked this pull request as ready for review June 30, 2026 10:52
@rukamori rukamori merged commit a80a2bc into ArchiveTuneApp:dev Jun 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BUG Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants