浏览代码

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

Kendall Garner 5 天之前
父节点
当前提交
091cb1c34a
共有 1 个文件被更改,包括 1 次插入1 次删除
  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);