Add resume capability to GetTempFile

This commit is contained in:
LukePulverenti
2013-03-14 15:52:53 -04:00
parent a7f06c84b1
commit fe1834e6be
10 changed files with 219 additions and 119 deletions

View File

@@ -100,7 +100,7 @@ namespace MediaBrowser.Controller.Providers
{
var path = item.Images[image];
return IsInSameDirectory(item, path) && !item.ResolveArgs.GetMetaFileByPath(path).HasValue;
return IsInMetaLocation(item, path) && !item.ResolveArgs.GetMetaFileByPath(path).HasValue;
}).ToList();
// Now remove them from the dictionary
@@ -122,7 +122,7 @@ namespace MediaBrowser.Controller.Providers
}
// Only validate paths from the same directory - need to copy to a list because we are going to potentially modify the collection below
var deletedImages = item.BackdropImagePaths.Where(path => IsInSameDirectory(item, path) && !item.ResolveArgs.GetMetaFileByPath(path).HasValue).ToList();
var deletedImages = item.BackdropImagePaths.Where(path => IsInMetaLocation(item, path) && !item.ResolveArgs.GetMetaFileByPath(path).HasValue).ToList();
// Now remove them from the dictionary
foreach (var path in deletedImages)
@@ -137,7 +137,7 @@ namespace MediaBrowser.Controller.Providers
/// <param name="item">The item.</param>
/// <param name="path">The path.</param>
/// <returns><c>true</c> if [is in same directory] [the specified item]; otherwise, <c>false</c>.</returns>
private bool IsInSameDirectory(BaseItem item, string path)
private bool IsInMetaLocation(BaseItem item, string path)
{
return string.Equals(Path.GetDirectoryName(path), item.MetaLocation, StringComparison.OrdinalIgnoreCase);
}