update playlist drag and drop

This commit is contained in:
Luke Pulverenti
2015-10-15 11:51:00 -04:00
parent 6c3355b26f
commit f4ad65196a
6 changed files with 73 additions and 57 deletions

View File

@@ -1748,8 +1748,6 @@ namespace MediaBrowser.Server.Implementations.Dto
return;
}
var path = imageInfo.Path;
ImageSize size;
try

View File

@@ -248,6 +248,11 @@ namespace MediaBrowser.Server.Implementations.Photos
if (image != null)
{
if (!image.IsLocalFile)
{
return false;
}
if (!FileSystem.ContainsSubPath(item.GetInternalMetadataPath(), image.Path))
{
return false;
@@ -269,6 +274,11 @@ namespace MediaBrowser.Server.Implementations.Photos
if (image != null)
{
if (!image.IsLocalFile)
{
return false;
}
if (!FileSystem.ContainsSubPath(item.GetInternalMetadataPath(), image.Path))
{
return false;

View File

@@ -111,7 +111,7 @@ namespace MediaBrowser.Server.Implementations.Playlists
try
{
_fileSystem.CreateDirectory(path);
_fileSystem.CreateDirectory(path);
var playlist = new Playlist
{
@@ -151,7 +151,7 @@ namespace MediaBrowser.Server.Implementations.Playlists
private string GetTargetPath(string path)
{
while (_fileSystem.DirectoryExists(path))
while (_fileSystem.DirectoryExists(path))
{
path += "1";
}
@@ -243,6 +243,16 @@ namespace MediaBrowser.Server.Implementations.Playlists
var oldIndex = children.FindIndex(i => string.Equals(entryId, i.Item1.Id, StringComparison.OrdinalIgnoreCase));
if (oldIndex == newIndex)
{
return;
}
if (newIndex > oldIndex)
{
newIndex--;
}
var item = playlist.LinkedChildren[oldIndex];
playlist.LinkedChildren.Remove(item);