aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorKendall Garner <17521368+kgarner7@users.noreply.github.com>2025-09-18 14:37:31 +0000
committerGitHub <noreply@github.com>2025-09-18 08:37:31 -0600
commit091cb1c34ab6707c24dcd35cb7ec589a4013038c (patch)
treeb64bd884baa43ab45961fac5587ca393f37f3aae /Emby.Server.Implementations
parenteaf33f01e1fce023491fe94d69f28de2f2c9666f (diff)
Fix playlist move from smaller to larger index (#14794)
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Playlists/PlaylistManager.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Playlists/PlaylistManager.cs b/Emby.Server.Implementations/Playlists/PlaylistManager.cs
index 1ce363de5..c9d76df0b 100644
--- a/Emby.Server.Implementations/Playlists/PlaylistManager.cs
+++ b/Emby.Server.Implementations/Playlists/PlaylistManager.cs
@@ -314,7 +314,7 @@ namespace Emby.Server.Implementations.Playlists
return;
}
- var newPriorItemIndex = newIndex > oldIndexAccessible ? newIndex : newIndex - 1 < 0 ? 0 : newIndex - 1;
+ var newPriorItemIndex = Math.Max(newIndex - 1, 0);
var newPriorItemId = accessibleChildren[newPriorItemIndex].Item1.ItemId;
var newPriorItemIndexOnAllChildren = children.FindIndex(c => c.Item1.ItemId.Equals(newPriorItemId));
var adjustedNewIndex = DetermineAdjustedIndex(newPriorItemIndexOnAllChildren, newIndex);