Repository navigation
Show how far into its song a radio stream is, when the stream knows - #1266
Merged
Merged
Conversation
A radio provider can report each song's duration and the position in it. The app dropped the duration of radio and timed it by the queue, which counts from when the station was tuned in. The position tracker now times such a queue by the song, so the player, the notification, Android Auto and Now Playing show the song's position and length. The queue time returns when the song report goes. A radio stream still cannot seek.
Collaborator
|
Thank you @culmat! |
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.
Closes #1264
It goes through the existing progress logic:
PlayerPositionTrackerstays the one source of the position, for the player, the notification, Android Auto and Now Playing.PlayerPositionTracker.setSongkeeps a second anchor per queue for the song a radio stream reports. Readers get it over the queue's anchor, except while an optimistic seek or track change is frozen. Queue-time events keep updating the queue's anchor underneath, and it shows again once the song report goes. No existingsetAnchorcall changed.MainDataSourcepasses each queue's song timing to the tracker just before the players publish, and only when the player's media belongs to the queue's current item.PlayerFactorygives radio media a duration only when the stream reports a song position, so every surface shows the song's length fromcurrentMedia.durationas for any track.RadioSongTimingTest; an Android test for the duration and the missing seek action.Normal tracks, audiobooks, podcasts and radio without a song report behave as before.
The server reports a song's position for a radio stream since music-assistant/server#7187. The web app gets the same in music-assistant/frontend#3042. See also https://github.com/orgs/music-assistant/discussions/6876: showing what a radio station plays, which this is one part of.
Are there any additional changes not related to the issue above?
No.
Before submitting this PR, make sure you have:
./gradlew detektAll testAndroidHostTest :androidApp:testDebug