Browse Source

Fix playlist move from smaller to larger index (#14794)

Kendall Garner 1 month ago
parent
commit
091cb1c34a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Emby.Server.Implementations/Playlists/PlaylistManager.cs

+ 1 - 1
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);