Duplicate Playlist, Maintain Order #5602

Closed
opened 2026-02-07 01:59:38 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @pixel24 on GitHub (Apr 14, 2024).

Originally assigned to: @nickyg91 on GitHub.

Please describe your bug

When duplicating a playlist, the track order is not preserved. I have a playlist that I want to use as a base for a new playlist. When I select the playlist in the web UI and choose "Add to Playlist" -> "New", I get a new playlist. However, the tracks are re-sorted or the original order is not preserved. Is this intentional?

Reproduction Steps

  1. Create a playlist with various music tracks.
  2. Rearrange the order of the tracks.
  3. Use this playlist to create a new playlist.
  4. The order will be different.

Jellyfin Version

10.8.13

if other:

none

Environment

- OS: Ubuntu 23.04
- Linux Kernel: 6.2.0-39-generic
- Virtualization: Proxmox / KVM
- Clients: Webclient
- Browser: Firefox

Jellyfin logs

To the operation, nothing is being written to the log.

FFmpeg logs

No response

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
Originally created by @pixel24 on GitHub (Apr 14, 2024). Originally assigned to: @nickyg91 on GitHub. ### Please describe your bug When duplicating a playlist, the track order is not preserved. I have a playlist that I want to use as a base for a new playlist. When I select the playlist in the web UI and choose "Add to Playlist" -> "New", I get a new playlist. However, the tracks are re-sorted or the original order is not preserved. Is this intentional? ### Reproduction Steps 1. Create a playlist with various music tracks. 2. Rearrange the order of the tracks. 3. Use this playlist to create a new playlist. 4. The order will be different. ### Jellyfin Version 10.8.13 ### if other: none ### Environment ```markdown - OS: Ubuntu 23.04 - Linux Kernel: 6.2.0-39-generic - Virtualization: Proxmox / KVM - Clients: Webclient - Browser: Firefox ``` ### Jellyfin logs ```shell To the operation, nothing is being written to the log. ``` ### FFmpeg logs _No response_ ### Please attach any browser or client logs here _No response_ ### Please attach any screenshots here _No response_ ### Code of Conduct - [X] I agree to follow this project's Code of Conduct
OVERLORD added the bugconfirmed labels 2026-02-07 01:59:38 +03:00
Author
Owner

@jellyfin-bot commented on GitHub (Apr 14, 2024):

Hi, it seems like your issue report has the following item(s) that need to be addressed:

  • The format of the environment section has been altered from the template.

This is an automated message, currently under testing. Please file an issue here if you encounter any problems.

@jellyfin-bot commented on GitHub (Apr 14, 2024): Hi, it seems like your issue report has the following item(s) that need to be addressed: - The format of the environment section has been altered from the template. This is an automated message, currently under testing. Please file an issue [here](https://github.com/jellyfin/jellyfin-triage-scripts/issues) if you encounter any problems.
Author
Owner

@solidsnake1298 commented on GitHub (Apr 14, 2024):

I confirmed this behavior in both stable and the current unstable build.

@solidsnake1298 commented on GitHub (Apr 14, 2024): I confirmed this behavior in both stable and the current unstable build.
Author
Owner

@nickyg91 commented on GitHub (Apr 16, 2024):

Hello! I am very new to this codebase as I literally just got it running locally and started looking over it. I did some digging, and it seems like the issue stems from the Playlist.GetPlaylistItems method. The InternalItemsQuery that runs (specifically in the case if the item is a Folder type) tells the query to order items by ItemSortBy.SortName and SortOrder.Ascending. Removing this line fixes the issue - but due to my unfamiliarity with the codebase I am not sure if this would break existing functionality. If you'd like, you can assign the issue to me, and I can dig in a little deeper to make sure it does not break anything else.

@nickyg91 commented on GitHub (Apr 16, 2024): Hello! I am _very_ new to this codebase as I literally just got it running locally and started looking over it. I did some digging, and it seems like the issue stems from the Playlist.GetPlaylistItems method. The InternalItemsQuery that runs (specifically in the case if the item is a Folder type) tells the query to order items by ItemSortBy.SortName and SortOrder.Ascending. Removing this line fixes the issue - but due to my unfamiliarity with the codebase I am not sure if this would break existing functionality. If you'd like, you can assign the issue to me, and I can dig in a little deeper to make sure it does not break anything else.
Author
Owner

@Chaphasilor commented on GitHub (Apr 17, 2024):

I think changing the default sorting when fetching playlist items is reasonable here. I see little use for the default sort, and since playlist items are inherently ordered, they should be returned in that order by default.

And any clients that fetch playlists will most likely apply the correct sorting already, which shouldn't break.

@Chaphasilor commented on GitHub (Apr 17, 2024): I think changing the default sorting when fetching playlist items is reasonable here. I see little use for the default sort, and since playlist items are inherently ordered, they should be returned in that order by default. And any clients that fetch playlists will most likely apply the correct sorting already, which shouldn't break.
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#5602