added image processor error handling

pull/702/head
Luke Pulverenti 11 years ago
parent 9758adb8a5
commit b07193e1bc

@ -85,7 +85,7 @@ namespace MediaBrowser.Api.LiveTv
{ {
var result = GetChannelsAsync(request).Result; var result = GetChannelsAsync(request).Result;
return ToOptimizedResult(result); return ToOptimizedResult(result.ToList());
} }
private async Task<IEnumerable<ChannelInfoDto>> GetChannelsAsync(GetChannels request) private async Task<IEnumerable<ChannelInfoDto>> GetChannelsAsync(GetChannels request)
@ -105,7 +105,7 @@ namespace MediaBrowser.Api.LiveTv
{ {
var result = GetRecordingsAsync(request).Result; var result = GetRecordingsAsync(request).Result;
return ToOptimizedResult(result); return ToOptimizedResult(result.ToList());
} }
private async Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(GetRecordings request) private async Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(GetRecordings request)

@ -53,7 +53,6 @@ namespace MediaBrowser.Server.Implementations.Drawing
private readonly IJsonSerializer _jsonSerializer; private readonly IJsonSerializer _jsonSerializer;
private readonly IServerApplicationPaths _appPaths; private readonly IServerApplicationPaths _appPaths;
private readonly string _imageSizeCachePath;
private readonly string _croppedWhitespaceImageCachePath; private readonly string _croppedWhitespaceImageCachePath;
private readonly string _enhancedImageCachePath; private readonly string _enhancedImageCachePath;
private readonly string _resizedImageCachePath; private readonly string _resizedImageCachePath;
@ -65,7 +64,6 @@ namespace MediaBrowser.Server.Implementations.Drawing
_jsonSerializer = jsonSerializer; _jsonSerializer = jsonSerializer;
_appPaths = appPaths; _appPaths = appPaths;
_imageSizeCachePath = Path.Combine(appPaths.ImageCachePath, "image-sizes");
_croppedWhitespaceImageCachePath = Path.Combine(appPaths.ImageCachePath, "cropped-images"); _croppedWhitespaceImageCachePath = Path.Combine(appPaths.ImageCachePath, "cropped-images");
_enhancedImageCachePath = Path.Combine(appPaths.ImageCachePath, "enhanced-images"); _enhancedImageCachePath = Path.Combine(appPaths.ImageCachePath, "enhanced-images");
_resizedImageCachePath = Path.Combine(appPaths.ImageCachePath, "resized-images"); _resizedImageCachePath = Path.Combine(appPaths.ImageCachePath, "resized-images");
@ -78,11 +76,17 @@ namespace MediaBrowser.Server.Implementations.Drawing
{ {
sizeDictionary = jsonSerializer.DeserializeFromFile<Dictionary<Guid, ImageSize>>(ImageSizeFile); sizeDictionary = jsonSerializer.DeserializeFromFile<Dictionary<Guid, ImageSize>>(ImageSizeFile);
} }
catch (IOException) catch (FileNotFoundException)
{ {
// No biggie // No biggie
sizeDictionary = new Dictionary<Guid, ImageSize>(); sizeDictionary = new Dictionary<Guid, ImageSize>();
} }
catch (Exception ex)
{
logger.ErrorException("Error parsing image size cache file", ex);
sizeDictionary = new Dictionary<Guid, ImageSize>();
}
_cachedImagedSizes = new ConcurrentDictionary<Guid, ImageSize>(sizeDictionary); _cachedImagedSizes = new ConcurrentDictionary<Guid, ImageSize>(sizeDictionary);
} }

Loading…
Cancel
Save