completed multiple movie in folder support

This commit is contained in:
Luke Pulverenti
2013-08-15 15:09:52 -04:00
parent 34bf41721a
commit 11c3778053
8 changed files with 121 additions and 164 deletions

View File

@@ -242,16 +242,9 @@ namespace MediaBrowser.Server.Implementations.Providers
if (saveLocally)
{
if (!(item is Episode))
if (item.IsInMixedFolder && !(item is Episode))
{
var video = item as Video;
if (video != null && video.IsInMixedFolder)
{
var folder = Path.GetDirectoryName(video.Path);
path = Path.Combine(folder, Path.GetFileNameWithoutExtension(video.Path) + "-" + filename);
}
path = GetSavePathForItemInMixedFolder(item, type, filename, extension);
}
if (string.IsNullOrEmpty(path) && !string.IsNullOrEmpty(item.MetaLocation))
@@ -260,6 +253,7 @@ namespace MediaBrowser.Server.Implementations.Providers
}
}
// None of the save local conditions passed, so store it in our internal folders
if (string.IsNullOrEmpty(path))
{
path = _remoteImageCache.GetResourcePath(item.GetType().FullName + item.Id, filename);
@@ -274,5 +268,16 @@ namespace MediaBrowser.Server.Implementations.Providers
return path;
}
private string GetSavePathForItemInMixedFolder(BaseItem item, ImageType type, string imageFilename, string extension)
{
if (type == ImageType.Primary)
{
return Path.ChangeExtension(item.Path, extension);
}
var folder = Path.GetDirectoryName(item.Path);
return Path.Combine(folder, Path.GetFileNameWithoutExtension(item.Path) + "-" + imageFilename);
}
}
}