-
Notifications
You must be signed in to change notification settings - Fork 1
Fixes recently played songs list to consistently display in correct order #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes issue #713 where the recently played songs list was not displaying in the correct order. The fix addresses an inconsistency between the initial data load (which returns a reversed list) and the SignalR real-time updates (which send the list in chronological order).
Key Changes:
- Added
Reverse()call to the SignalR event handler to ensure real-time updates display songs in the same order as the initial load
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@Psychoboy I've opened a new pull request, #743, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Use LINQ Reverse().ToList() to avoid mutating original songs list Co-authored-by: Psychoboy <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Psychoboy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| recentlyPlayedSongs = songs.ToList(); | ||
| recentlyPlayedSongs.Reverse(); |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this fix works to maintain consistent ordering between initial load and SignalR updates, it would be more maintainable to fix this at the source in YtPlayer.cs. The SendLastPlayedSongs method should reverse the list before sending (like GetRecentlyPlayedSongs does on line 886 of YtPlayer.cs), ensuring all clients receive consistently ordered data. This client-side reversal creates a discrepancy where GetRecentlyPlayedSongs returns reversed data but SendLastPlayedSongs sends unreversed data, requiring all clients to know about and handle this inconsistency.
fixes #713