[GH-ISSUE #1545] Sorting isn't applied #698

Open
opened 2026-02-27 19:32:01 +03:00 by kerem · 5 comments
Owner

Originally created by @acid-sun on GitHub (Aug 21, 2025).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1545

Playlist playback order is broken if the playlist is not sorted by default.

Description

If you sort playlist by add date and start play, play order is reverse.

Version

librespot 0.6.0-dev 78ce118 (Built on 2025-08-21, Build ID: ocjahGFT, Profile: release)

How to reproduce

  1. Open any playlist and sort by 'Recently added'.
  2. Start play 4th track.
  3. Switch to next track.
  4. Now play 3th track.

Host (what you are running librespot on):

  • OS: Linux, Windows
  • Platform: Lepotato

Additional context

Early versions don't have this problem ([librespot @ 383a6f6]).

Originally created by @acid-sun on GitHub (Aug 21, 2025). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1545 Playlist playback order is broken if the playlist is not sorted by default. ### Description If you sort playlist by add date and start play, play order is reverse. ### Version librespot 0.6.0-dev 78ce118 (Built on 2025-08-21, Build ID: ocjahGFT, Profile: release) ### How to reproduce 1. Open any playlist and sort by 'Recently added'. 2. Start play 4th track. 3. Switch to next track. 4. Now play 3th track. ### Host (what you are running `librespot` on): - OS: Linux, Windows - Platform: Lepotato ### Additional context Early versions don't have this problem ([librespot @ 383a6f6]).
Author
Owner

@photovoltex commented on GitHub (Aug 21, 2025):

That's probably because we currently don't use the values that are sent for sorting and such. Probably not a bug and more a missing implementation/feature?

<!-- gh-comment-id:3212029858 --> @photovoltex commented on GitHub (Aug 21, 2025): That's probably because we currently don't use the values that are sent for sorting and such. Probably not a bug and more a missing implementation/feature?
Author
Owner

@acid-sun commented on GitHub (Oct 21, 2025):

Commit 5839b36 break order and queue.

  1. Sort my playlist by Date added.
    Image
  2. Push play. Played last track.
    Image
  3. Queue is wrong too.
    Image

Before 5839b36, work correct.

<!-- gh-comment-id:3426178406 --> @acid-sun commented on GitHub (Oct 21, 2025): Commit 5839b36 break order and queue. 1. Sort my playlist by Date added. <img width="1129" height="318" alt="Image" src="https://github.com/user-attachments/assets/6fee6b01-f99c-4d88-b10a-12904247f022" /> 2. Push play. Played last track. <img width="1116" height="297" alt="Image" src="https://github.com/user-attachments/assets/03ca593d-c621-4a4e-9458-b9b4bff23193" /> 3. Queue is wrong too. <img width="1120" height="315" alt="Image" src="https://github.com/user-attachments/assets/db9395db-1f06-42b2-9294-672c028c4f71" /> Before 5839b36, work correct.
Author
Owner

@photovoltex commented on GitHub (Oct 22, 2025):

Jep, that's the big rework of the connect handling. I recently saw how the sorting is retrieved in the play command, but it's not something we can easily apply currently unless I'm missing something on my end there.

<!-- gh-comment-id:3432436928 --> @photovoltex commented on GitHub (Oct 22, 2025): Jep, that's the big rework of the connect handling. I recently saw how the sorting is retrieved in the play command, but it's not something we can easily apply currently unless I'm missing something on my end there.
Author
Owner

@PinguDEV-original commented on GitHub (Feb 4, 2026):

Is there anything happening regarding this? It'd be really cool to see that implemented

<!-- gh-comment-id:3846903547 --> @PinguDEV-original commented on GitHub (Feb 4, 2026): Is there anything happening regarding this? It'd be really cool to see that implemented
Author
Owner

@photovoltex commented on GitHub (Feb 9, 2026):

I think implementing this might be quite a hassle as the metadata of an context only gives us the details how you can sort it. So something like "name asc". As we are only a library we only keep necessary info in context and don't query for anymore info then necessary. Because of that we only have the uri of a track to work with.

Supporting sorting would mean, we find out if the context andpoint has a query or header parameter where you can provide the sorting info, so that the context is already returned. Or we would need to query all track metadata and sort them ourself.

Feel free to dig into the topic and contribute to it, but that's the general details I remember when I work on the connect implementation.

<!-- gh-comment-id:3873224889 --> @photovoltex commented on GitHub (Feb 9, 2026): I think implementing this might be quite a hassle as the metadata of an context only gives us the details how you can sort it. So something like "name asc". As we are only a library we only keep necessary info in context and don't query for anymore info then necessary. Because of that we only have the uri of a track to work with. Supporting sorting would mean, we find out if the context andpoint has a query or header parameter where you can provide the sorting info, so that the context is already returned. Or we would need to query all track metadata and sort them ourself. Feel free to dig into the topic and contribute to it, but that's the general details I remember when I work on the connect implementation.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#698
No description provided.