aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Playlists
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-07-17 13:11:39 -0400
committerGitHub <noreply@github.com>2016-07-17 13:11:39 -0400
commitdc264a2cf1568f1e439115b4426c1eefb5c46442 (patch)
tree2c3bff38ee0e9ffcbfe598c9d3652f1b6f87373d /MediaBrowser.Server.Implementations/Playlists
parentf29191a0a16763eab1e74eac4d41777ad3738a47 (diff)
parent794b13b8167530f4a0b083fba414a332b723e594 (diff)
Merge pull request #1949 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/Playlists')
-rw-r--r--MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs b/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs
index 53c03b91c1..ba1559bd03 100644
--- a/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs
+++ b/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs
@@ -247,15 +247,18 @@ namespace MediaBrowser.Server.Implementations.Playlists
return;
}
- if (newIndex > oldIndex)
- {
- newIndex--;
- }
-
var item = playlist.LinkedChildren[oldIndex];
playlist.LinkedChildren.Remove(item);
- playlist.LinkedChildren.Insert(newIndex, item);
+
+ if (newIndex >= playlist.LinkedChildren.Count)
+ {
+ playlist.LinkedChildren.Add(item);
+ }
+ else
+ {
+ playlist.LinkedChildren.Insert(newIndex, item);
+ }
await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
}