Skip to content

Conversation

@Psychoboy
Copy link
Owner

fixes #713

Copilot AI review requested due to automatic review settings December 22, 2025 18:40
Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI commented Dec 22, 2025

@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.

Copilot AI and others added 2 commits December 22, 2025 11:52
* 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]>
Copy link
Contributor

Copilot AI left a 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.

Comment on lines +54 to +55
recentlyPlayedSongs = songs.ToList();
recentlyPlayedSongs.Reverse();
Copy link

Copilot AI Dec 22, 2025

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.

Copilot uses AI. Check for mistakes.
@Psychoboy Psychoboy merged commit 985c793 into main Dec 22, 2025
12 checks passed
@Psychoboy Psychoboy deleted the fixRecentlyPlayedSongs branch December 22, 2025 19:07
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.

Last Played updates wrong

2 participants