fix: respect offline playlist sort order in player queue#830
Conversation
|
@elias001011 What's the situation with online playlists? Does it handle the case correctly? |
|
@gokadzev Hi! I've checked the implementation details. In PlaylistPage, the sorting logic directly modifies the _playlist['list'] object, so the audioHandler receives the already sorted list. However, in UserSongsPage (Offline Songs), the sorting is only applied to a local variable for display purposes (_getDisplayList), while the 'Play' button and song taps still reference the original unsorted userOfflineSongs list. My PR fixes this specifically for the offline section by ensuring the sorted list is passed to the audioHandler, matching the behavior users expect from the UI |
UserSongsPage is used not only for offline songs, but also recently played songs and liked songs |
No, the other sections (liked songs and recently played) don't have any sorting feature at all - they're just displayed in the default order. So the bug only affects offline songs because that's the only section that has sorting options. My fix specifically targets only the offline songs case and won't have any effect on the other sections since they don't have sorting functionality. |
That's what I was trying to recall. Approved then. Thanks! |
Description
This PR fixes a bug where the playback queue for "Offline Songs" would always follow the default order, ignoring any active sorting criteria (e.g., "Date Added", "Title", or "Artist").
Changes
UserSongsPageto ensure that when a song is played (either via the main "Play" button or by tapping a specific song), the list passed to theaudioHandleris correctly sorted according to the user's current selection._sortOfflineSongsLocaland_getCurrentOfflineSortTypelogic to derive the sorted list before initializing the playlist payload.