fix: decode per-row like status for radio queues#395
Open
WGlegola wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.parseSongsbuilt each queuedSongwithlikeStatus == nil, dropping thelikeStatusthat the sameplaylistPanelVideoRenderer.menucarries (and thatSongMetadataParseralready decodes for the seed track). The queue row then resolved its thumb solely fromSongLikeStatusManager'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
RadioQueueParsernow decodes each row's like status from its ownmenu(reusingSongMetadataParser.parseMenuData) and setsSong.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.parseMenuDatais made robust to a missing overflow-itemsmenu, solikeStatus(which lives intopLevelButtons) is never dropped when a menu lacksitems.Tests
Added
RadioQueueParserTestscovering LIKE/DISLIKE/INDIFFERENT decode, the nil-when-no-menu guard, the wrapped-renderer path, and the continuation path. Full non-UI suite passes;swiftlint --strictandswiftformatclean.