Repository navigation
fix(play): follow a song found for a link though its app has it some seconds longer - #1313
Merged
Merged
Conversation
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.
A song opened from a link was played in its app and then taken for another song: the card's Lyrics didn't move with it, and its practice cards made no sound. Reported with a Deezer link to WINK's "愛が止まらない ~Turn it into love~ (Original Remastered 2018)" played in YouTube Music.
Cause
Measured on the Samsung with that link and a logging build.
ExactMatchertakes a pick up to 8 s off (SAME_LENGTH_MS), so it opens it. That's right.MediaController.anotherRecordinginPlayback.kthad a rule of its own: more than 3 s off is another recording. Soplays(song)was false for the song Crosstune had just opened:another=true names=truein the log.flowchart LR link[Deezer link, 208.0 s] --> matcher[ExactMatcher: up to 8 s off] matcher --> app[YouTube Music plays 212.9 s] app --> follower{follower: how far off?} follower -->|before: over 3 s| no[another recording, not followed] follower -->|now: up to 8 s| yes[followed: words move, cards play]Fix
The follower uses the matcher's limit. A song the matcher can pick for a link is then a song Crosstune follows, however it got to the app: Play, Open, Recent, a practice card, or the app's own queue after a restart.
Tests
PlaybackTest.aSongFoundForALinkIsFollowedThoughItsAppHasItSomeSecondsLonger: the reported song, by both names and lengths.anotherVersionOfASongPausedInItsAppIsntTheOneAskedForholds the new limit from both sides: 8 s off is the song, 8.001 s isn't.Version
2.29.1 (2290100), with its changelog line.
Done when
:app:cipasses locally (ea39637, BUILD SUCCESSFUL in 30m 23s; the later commit only bumps the version)mutantsincluded)Review
One Sonnet review of the full diff. No defect in the follower. Two trade-offs it named:
mainstarted the linked one." Kept on purpose. By length alone that take can't be told from the reported case, which has to be carried on: a practice card of the song finds YouTube Music paused on the 212.9 s take. The matcher would pick either take for the link.Known issues
Issue #1312.