update listviews

This commit is contained in:
Luke Pulverenti 2016-07-16 14:02:39 -04:00
parent e329811d2d
commit 08931dabff

View file

@ -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);
}