diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-19 02:18:29 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-19 02:18:29 -0400 |
| commit | 759f5a856064450acdb4c26839d6d890afb99a17 (patch) | |
| tree | bc90bdc82a218644a1baa6762105afba6062b7ce /MediaBrowser.Api/Images/ImageService.cs | |
| parent | 244531f9923bec28f4b1f6d55ad6858bd90f2135 (diff) | |
update task results
Diffstat (limited to 'MediaBrowser.Api/Images/ImageService.cs')
| -rw-r--r-- | MediaBrowser.Api/Images/ImageService.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index e5fe5bd68..a511f8c72 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -514,7 +514,7 @@ namespace MediaBrowser.Api.Images /// <param name="isHeadRequest">if set to <c>true</c> [is head request].</param> /// <returns>System.Object.</returns> /// <exception cref="ResourceNotFoundException"></exception> - public object GetImage(ImageRequest request, IHasImages item, bool isHeadRequest) + public Task<object> GetImage(ImageRequest request, IHasImages item, bool isHeadRequest) { if (request.PercentPlayed.HasValue) { @@ -594,8 +594,7 @@ namespace MediaBrowser.Api.Images supportedImageEnhancers, cacheDuration, responseHeaders, - isHeadRequest) - .Result; + isHeadRequest); } private async Task<object> GetImageResult(IHasImages item, @@ -632,7 +631,7 @@ namespace MediaBrowser.Api.Images headers["Vary"] = "Accept"; - return ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions + return await ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions { CacheDuration = cacheDuration, ResponseHeaders = headers, @@ -643,7 +642,8 @@ namespace MediaBrowser.Api.Images // Sometimes imagemagick keeps a hold on the file briefly even after it's done writing to it. // I'd rather do this than add a delay after saving the file FileShare = FileShare.ReadWrite - }); + + }).ConfigureAwait(false); } private List<ImageFormat> GetOutputFormats(ImageRequest request, ItemImageInfo image, bool cropwhitespace, List<IImageEnhancer> enhancers) |
