Albums added to playlists sorted by ItemIDs not track numbers #6528

Closed
opened 2026-02-07 03:45:39 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @cmt29 on GitHub (Nov 30, 2024).

This issue respects the following points:

  • This is a bug, not a question or a configuration issue; Please visit our forum or chat rooms first to troubleshoot with volunteers, before creating a report. The links can be found here.
  • This issue is not already reported on GitHub (I've searched it).
  • I'm using an up to date version of Jellyfin Server stable, unstable or master; We generally do not support previous older versions. If possible, please update to the latest version before opening an issue.
  • I agree to follow Jellyfin's Code of Conduct.
  • This report addresses only a single issue; If you encounter multiple issues, kindly create separate reports for each one.

Description of the bug

When adding an album to a playlist, the tracks are sorted by ItemIDs rather than track numbers, resulting in an apparent random ordering.

Reproduction steps

  1. Add an album to a playlist.

What is the current bug behavior?

Tracks from album added to playlists are in an apparent random order.

What is the expected correct behavior?

Tracks should be added to playlist in album order, sorted by track numbers.

Jellyfin Server version

10.10.0+

Specify commit id

No response

Specify unstable release number

No response

Specify version number

No response

Specify the build version

10.10.3

Environment

- OS: Debian 
- Linux Kernel: 6.6.51
- Virtualization: none
- Clients: Android
- Browser: n/a

Jellyfin logs

N/A

FFmpeg logs


Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

As discussed in Jellyfin Forums here: https://forum.jellyfin.org/t-album-tracks-shuffle-when-added-to-playlists

Originally created by @cmt29 on GitHub (Nov 30, 2024). ### This issue respects the following points: - [x] This is a **bug**, not a question or a configuration issue; Please visit our forum or chat rooms first to troubleshoot with volunteers, before creating a report. The links can be found [here](https://jellyfin.org/contact/). - [x] This issue is **not** already reported on [GitHub](https://github.com/jellyfin/jellyfin/issues?q=is%3Aopen+is%3Aissue) _(I've searched it)_. - [x] I'm using an up to date version of Jellyfin Server stable, unstable or master; We generally do not support previous older versions. If possible, please update to the latest version before opening an issue. - [x] I agree to follow Jellyfin's [Code of Conduct](https://jellyfin.org/docs/general/community-standards.html#code-of-conduct). - [x] This report addresses only a single issue; If you encounter multiple issues, kindly create separate reports for each one. ### Description of the bug When adding an album to a playlist, the tracks are sorted by ItemIDs rather than track numbers, resulting in an apparent random ordering. ### Reproduction steps 1. Add an album to a playlist. ### What is the current _bug_ behavior? Tracks from album added to playlists are in an apparent random order. ### What is the expected _correct_ behavior? Tracks should be added to playlist in album order, sorted by track numbers. ### Jellyfin Server version 10.10.0+ ### Specify commit id _No response_ ### Specify unstable release number _No response_ ### Specify version number _No response_ ### Specify the build version 10.10.3 ### Environment ```markdown - OS: Debian - Linux Kernel: 6.6.51 - Virtualization: none - Clients: Android - Browser: n/a ``` ### Jellyfin logs ```shell N/A ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information As discussed in Jellyfin Forums here: [https://forum.jellyfin.org/t-album-tracks-shuffle-when-added-to-playlists](https://forum.jellyfin.org/t-album-tracks-shuffle-when-added-to-playlists)
OVERLORD added the enhancementconfirmedui & ux labels 2026-02-07 03:45:39 +03:00
Author
Owner

@cmt29 commented on GitHub (Dec 3, 2024):

@gnattu Thanks for engagement on this issue. Why an enhancement and not a bug?
Any good workarounds?
Thanks.

@cmt29 commented on GitHub (Dec 3, 2024): @gnattu Thanks for engagement on this issue. Why an enhancement and not a bug? Any good workarounds? Thanks.
Author
Owner

@thearrow commented on GitHub (Jan 9, 2025):

would love to help with this if possible. ran into this issue today and it's very annoying. i'm a total noob to the jellyfin repos, but my initial look suggests:

  1. the API layer (that jellyfin-web uses to communicate with the backend server) takes a playlistId and a collection of itemIds to add to that playlist.
  2. there is already some preprocessing happening in that backend endpoint (e.g. removing duplicates)
  3. but there appears to be no sorting, so new items are added to the playlist in whatever order (itemId?)

would it be possible to add additional preprocessing to the backend code that checks whether each of the new items is a music track with a track number, and if so, sort the items by that track number before actually adding them?

@thearrow commented on GitHub (Jan 9, 2025): would love to help with this if possible. ran into this issue today and it's very annoying. i'm a total noob to the jellyfin repos, but my initial look suggests: 1. the API layer (that jellyfin-web uses to communicate with the backend server) takes a `playlistId` and a collection of `itemIds` to add to that playlist. 2. there is already some preprocessing happening in that backend endpoint (e.g. [removing duplicates](https://github.com/jellyfin/jellyfin/blob/5b63d093b1f7f2704d5e56fd0b5275e4dbf0fa80/Emby.Server.Implementations/Playlists/PlaylistManager.cs#L219-L223)) 3. but there appears to be no sorting, so new items are added to the playlist in whatever order (itemId?) would it be possible to add additional preprocessing to the backend code that checks whether each of the new items is a music track with a track number, and if so, sort the items by that track number before [actually adding them](https://github.com/jellyfin/jellyfin/blob/5b63d093b1f7f2704d5e56fd0b5275e4dbf0fa80/Emby.Server.Implementations/Playlists/PlaylistManager.cs#L244)?
Author
Owner

@JamesSpellman commented on GitHub (Mar 15, 2025):

Tracks and Disc order. I've been rearranging The Wall over and over and it doesn't remember half of it. Going to try maybe adding songs to the playlist one at a time.

@JamesSpellman commented on GitHub (Mar 15, 2025): Tracks and Disc order. I've been rearranging The Wall over and over and it doesn't remember half of it. Going to try maybe adding songs to the playlist one at a time.
Author
Owner

@u-lulu commented on GitHub (Apr 11, 2025):

For anyone else running into this issue, I've discovered a workaround: instead of adding the album itself to a playlist, press the play button on the album, open the play queue, and save the play queue to the playlist instead. This preserves the order of the album.

@u-lulu commented on GitHub (Apr 11, 2025): For anyone else running into this issue, I've discovered a workaround: instead of adding the album itself to a playlist, press the play button on the album, open the play queue, and save the play queue to the playlist instead. This preserves the order of the album.
Author
Owner

@cmt29 commented on GitHub (Apr 11, 2025):

Thanks @u-lulu - I hadn't thought of that. Good workaround!

@cmt29 commented on GitHub (Apr 11, 2025): Thanks @u-lulu - I hadn't thought of that. Good workaround!
Author
Owner

@felix920506 commented on GitHub (Apr 17, 2025):

Can confirm this happens on 10.10.7

Going to wait for this issue to be confirmed on master before tagging as confirmed.

Confirming this issue on master is currently blocked by #13936

@felix920506 commented on GitHub (Apr 17, 2025): Can confirm this happens on 10.10.7 Going to wait for this issue to be confirmed on master before tagging as confirmed. Confirming this issue on master is currently blocked by #13936
Author
Owner

@theguymadmax commented on GitHub (May 15, 2025):

This issue is fixed on the current master.

@theguymadmax commented on GitHub (May 15, 2025): This issue is fixed on the current master.
Author
Owner

@ldexterldesign commented on GitHub (Jul 13, 2025):

👋 @theguymadmax,

Thanks for notification

Please confirm what version I/we should (all) update to, to resolve this issue?

🤞

@ldexterldesign commented on GitHub (Jul 13, 2025): 👋 @theguymadmax, Thanks for notification Please confirm what version I/we should (all) update to, to resolve this issue? 🤞
Author
Owner

@ldexterldesign commented on GitHub (Jul 13, 2025):

👋 https://github.com/jellyfin/jellyfin-web/issues/7019

@ldexterldesign commented on GitHub (Jul 13, 2025): 👋 https://github.com/jellyfin/jellyfin-web/issues/7019
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#6528