Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Playlist, Maintain Order #11354

Closed
1 task done
pixel24 opened this issue Apr 14, 2024 · 4 comments · Fixed by #11371
Closed
1 task done

Duplicate Playlist, Maintain Order #11354

pixel24 opened this issue Apr 14, 2024 · 4 comments · Fixed by #11371
Assignees
Labels
bug Something isn't working confirmed This issue has been reviewed and confirmed

Comments

@pixel24
Copy link

pixel24 commented Apr 14, 2024

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
@pixel24 pixel24 added the bug Something isn't working label Apr 14, 2024
@jellyfin-bot
Copy link
Contributor

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.

@solidsnake1298
Copy link
Member

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

@solidsnake1298 solidsnake1298 added the confirmed This issue has been reviewed and confirmed label Apr 14, 2024
@jellyfin-bot jellyfin-bot added this to Needs triage in Issue Triage for Main Repo Apr 14, 2024
@nickyg91
Copy link
Contributor

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.

@Chaphasilor
Copy link

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.

Issue Triage for Main Repo automation moved this from Needs triage to Closed/Done Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed This issue has been reviewed and confirmed
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants