aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Images/RemoteImageService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-09 02:27:44 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-09 02:27:44 -0500
commitaac392f4cd7da4fc40a4cf948783249365bc8e0c (patch)
treeababbbbb24f521bdeb4f7f8cc5ab6b8753a0fa16 /MediaBrowser.Api/Images/RemoteImageService.cs
parent41b9ce56efb4f4ff013f7d4d7aa30a4c6dca7789 (diff)
add audio db for artists
Diffstat (limited to 'MediaBrowser.Api/Images/RemoteImageService.cs')
-rw-r--r--MediaBrowser.Api/Images/RemoteImageService.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Images/RemoteImageService.cs b/MediaBrowser.Api/Images/RemoteImageService.cs
index 895904da7..fc2ced1a6 100644
--- a/MediaBrowser.Api/Images/RemoteImageService.cs
+++ b/MediaBrowser.Api/Images/RemoteImageService.cs
@@ -320,6 +320,10 @@ namespace MediaBrowser.Api.Images
return ToStaticFileResult(contentPath);
}
}
+ catch (DirectoryNotFoundException)
+ {
+ // Means the file isn't cached yet
+ }
catch (FileNotFoundException)
{
// Means the file isn't cached yet
@@ -356,7 +360,6 @@ namespace MediaBrowser.Api.Images
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
Directory.CreateDirectory(Path.GetDirectoryName(fullCachePath));
-
using (var stream = result.Content)
{
using (var filestream = _fileSystem.GetFileStream(fullCachePath, FileMode.Create, FileAccess.Write, FileShare.Read, true))
@@ -365,6 +368,7 @@ namespace MediaBrowser.Api.Images
}
}
+ Directory.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
using (var writer = new StreamWriter(pointerCachePath))
{
await writer.WriteAsync(fullCachePath).ConfigureAwait(false);