Skip to content

fix: decode per-row like status for radio queues#395

Open
WGlegola wants to merge 1 commit into
sozercan:mainfrom
WGlegola:fix/queue-like-status
Open

fix: decode per-row like status for radio queues#395
WGlegola wants to merge 1 commit into
sozercan:mainfrom
WGlegola:fix/queue-like-status

Conversation

@WGlegola

Copy link
Copy Markdown
Contributor

Problem

In the queue side panel ("Up Next"), a track's like/thumbs-up indicator depended on how much of the user's Liked Music playlist had loaded in the background. Playing from the main Search bar builds a radio "Up Next", and as Liked Music paginated in, more queue rows would progressively light up as liked — because the like status wasn't attached to the queued songs, only resolved from a global cache that Liked Music seeds incrementally.

Root cause

RadioQueueParser.parseSongs built each queued Song with likeStatus == nil, dropping the likeStatus that the same playlistPanelVideoRenderer.menu carries (and that SongMetadataParser already decodes for the seed track). The queue row then resolved its thumb solely from SongLikeStatusManager's cache (cache[videoId] ?? song.likeStatus), which is seeded batch-by-batch by Liked Music pagination — so rows lit up as more batches loaded.

Fix

  • RadioQueueParser now decodes each row's like status from its own menu (reusing SongMetadataParser.parseMenuData) and sets Song.likeStatus, so every queued row carries an authoritative per-track status independent of cache-seeding timing. Library/feedback fields are intentionally left unset to avoid suppressing the single-track metadata fetch and queue enrichment.
  • SongMetadataParser.parseMenuData is made robust to a missing overflow-items menu, so likeStatus (which lives in topLevelButtons) is never dropped when a menu lacks items.
  • The cache remains checked first, so a live rating change (from the queue row, now-playing, or Liked Music seeding) still overrides the parsed value.

Tests

Added RadioQueueParserTests covering LIKE/DISLIKE/INDIFFERENT decode, the nil-when-no-menu guard, the wrapped-renderer path, and the continuation path. Full non-UI suite passes; swiftlint --strict and swiftformat clean.

Radio "Up Next" rows built by RadioQueueParser carried likeStatus == nil,
so the queue thumb resolved solely from the global like-status cache — which
is seeded incrementally by Liked Music pagination, making rows light up as
liked only as more batches loaded.

Decode each row's like status from its own playlistPanelVideoRenderer.menu
(reusing SongMetadataParser.parseMenuData), and make parseMenuData robust to
a missing overflow-items menu so topLevelButtons/likeStatus is never dropped.
Library/feedback fields are intentionally left unset to avoid suppressing the
authoritative single-track metadata fetch and queue enrichment.
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