[PR #14794] [MERGED] Fix playlist move from smaller to larger index #14121

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

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/14794
Author: @kgarner7
Created: 9/13/2025
Status: Merged
Merged: 9/18/2025
Merged by: @crobibero

Base: masterHead: fix-playlist-song-reordering


📝 Commits (2)

  • bdfc719 Fix playlist move from smaller to larger index
  • 2ddee80 Update Emby.Server.Implementations/Playlists/PlaylistManager.cs

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 Emby.Server.Implementations/Playlists/PlaylistManager.cs (+1 -1)

📄 Description

Changes
When attempting to use the /move API to move from a smaller index to a larger one, the actual value is one greater.
The fix for this is to always remove one from the index (except where it is already zero).
Before: insertBeforeIndex = newIndex + 1 (from DetermineAdjustedIndex) + 1 (the item is removed from the list) = newIndex + 2
After: insertBeforeIndex = newINdex + 1 (from DetermineAdjustedIndex) - 1 (from this PR) + 1 (item is removed from list, things are offset by 1) = newIndex + 1

Issues
Fixes #14792


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/14794 **Author:** [@kgarner7](https://github.com/kgarner7) **Created:** 9/13/2025 **Status:** ✅ Merged **Merged:** 9/18/2025 **Merged by:** [@crobibero](https://github.com/crobibero) **Base:** `master` ← **Head:** `fix-playlist-song-reordering` --- ### 📝 Commits (2) - [`bdfc719`](https://github.com/jellyfin/jellyfin/commit/bdfc719535a39a1dc21b2bcd8ba4976866387a66) Fix playlist move from smaller to larger index - [`2ddee80`](https://github.com/jellyfin/jellyfin/commit/2ddee808a6ef61edaebf01712938e2a2b3f23c85) Update Emby.Server.Implementations/Playlists/PlaylistManager.cs ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Server.Implementations/Playlists/PlaylistManager.cs` (+1 -1) </details> ### 📄 Description <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> **Changes** When attempting to use the `/move` API to move from a smaller index to a larger one, the actual value is one greater. The fix for this is to always remove one from the index (except where it is already zero). Before: `insertBeforeIndex = newIndex + 1 (from DetermineAdjustedIndex) + 1 (the item is removed from the list) = newIndex + 2` After: `insertBeforeIndex = newINdex + 1 (from DetermineAdjustedIndex) - 1 (from this PR) + 1 (item is removed from list, things are offset by 1) = newIndex + 1` **Issues** Fixes #14792 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:24:45 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14121