update dynamic images

This commit is contained in:
Luke Pulverenti
2015-10-30 12:45:22 -04:00
parent 9bfb2f0813
commit 8ea02ee020
7 changed files with 20 additions and 113 deletions

View File

@@ -119,13 +119,9 @@ namespace MediaBrowser.Providers.Manager
var index = imageIndex ?? 0;
var paths = !string.IsNullOrEmpty(internalCacheKey) ?
new[] { GetCacheKeyPath(item, type, mimeType, internalCacheKey) } :
GetSavePaths(item, type, imageIndex, mimeType, saveLocally);
var paths = GetSavePaths(item, type, imageIndex, mimeType, saveLocally);
var retryPaths = !string.IsNullOrEmpty(internalCacheKey) ?
new[] { GetCacheKeyPath(item, type, mimeType, internalCacheKey) } :
GetSavePaths(item, type, imageIndex, mimeType, false);
var retryPaths = GetSavePaths(item, type, imageIndex, mimeType, false);
// If there are more than one output paths, the stream will need to be seekable
var memoryStream = new MemoryStream();
@@ -196,7 +192,7 @@ namespace MediaBrowser.Providers.Manager
}
catch (UnauthorizedAccessException)
{
var retry = !string.IsNullOrWhiteSpace(retryPath) &&
var retry = !string.IsNullOrWhiteSpace(retryPath) &&
!string.Equals(path, retryPath, StringComparison.OrdinalIgnoreCase);
if (retry)
@@ -213,12 +209,6 @@ namespace MediaBrowser.Providers.Manager
await SaveImageToLocation(source, retryPath, cancellationToken).ConfigureAwait(false);
}
private string GetCacheKeyPath(IHasImages item, ImageType type, string mimeType, string key)
{
var extension = MimeTypes.ToExtension(mimeType);
return Path.Combine(item.GetInternalMetadataPath(), type.ToString().ToLower() + "_key_" + key + extension);
}
/// <summary>
/// Saves the image to location.
/// </summary>