diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj index fe5004f87a..d9a85c8b05 100644 --- a/MediaBrowser.Api/MediaBrowser.Api.csproj +++ b/MediaBrowser.Api/MediaBrowser.Api.csproj @@ -39,37 +39,37 @@ ..\packages\morelinq.1.0.15631-beta\lib\net35\MoreLinq.dll - + False - ..\packages\ServiceStack.3.9.38\lib\net35\ServiceStack.dll + ..\packages\ServiceStack.3.9.40\lib\net35\ServiceStack.dll - + False - ..\packages\ServiceStack.Common.3.9.38\lib\net35\ServiceStack.Common.dll + ..\packages\ServiceStack.Common.3.9.40\lib\net35\ServiceStack.Common.dll - + False - ..\packages\ServiceStack.Common.3.9.38\lib\net35\ServiceStack.Interfaces.dll + ..\packages\ServiceStack.Common.3.9.40\lib\net35\ServiceStack.Interfaces.dll - + False - ..\packages\ServiceStack.OrmLite.SqlServer.3.9.39\lib\ServiceStack.OrmLite.dll + ..\packages\ServiceStack.OrmLite.SqlServer.3.9.41\lib\ServiceStack.OrmLite.dll False - ..\packages\ServiceStack.OrmLite.SqlServer.3.9.39\lib\ServiceStack.OrmLite.SqlServer.dll + ..\packages\ServiceStack.OrmLite.SqlServer.3.9.41\lib\ServiceStack.OrmLite.SqlServer.dll - + False - ..\packages\ServiceStack.Redis.3.9.38\lib\net35\ServiceStack.Redis.dll + ..\packages\ServiceStack.Redis.3.9.40\lib\net35\ServiceStack.Redis.dll False - ..\packages\ServiceStack.3.9.38\lib\net35\ServiceStack.ServiceInterface.dll + ..\packages\ServiceStack.3.9.40\lib\net35\ServiceStack.ServiceInterface.dll - + False - ..\packages\ServiceStack.Text.3.9.38\lib\net35\ServiceStack.Text.dll + ..\packages\ServiceStack.Text.3.9.40\lib\net35\ServiceStack.Text.dll diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs index ff914c8c54..8dc9cfd62d 100644 --- a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs +++ b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs @@ -2,7 +2,6 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Querying; -using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using System; using System.Collections.Generic; diff --git a/MediaBrowser.Api/packages.config b/MediaBrowser.Api/packages.config index 3eab57f7d6..8752534c44 100644 --- a/MediaBrowser.Api/packages.config +++ b/MediaBrowser.Api/packages.config @@ -1,9 +1,9 @@  - - - - - + + + + + \ No newline at end of file diff --git a/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj b/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj index f73dac71fd..f2cdb72e40 100644 --- a/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj +++ b/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj @@ -44,9 +44,9 @@ ..\packages\protobuf-net.2.0.0.621\lib\net40\protobuf-net.dll - + False - ..\packages\ServiceStack.Text.3.9.38\lib\net35\ServiceStack.Text.dll + ..\packages\ServiceStack.Text.3.9.40\lib\net35\ServiceStack.Text.dll ..\packages\SimpleInjector.2.0.0-beta5\lib\net40-client\SimpleInjector.dll diff --git a/MediaBrowser.Common.Implementations/packages.config b/MediaBrowser.Common.Implementations/packages.config index 0c064f3e45..cce784a797 100644 --- a/MediaBrowser.Common.Implementations/packages.config +++ b/MediaBrowser.Common.Implementations/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/MediaBrowser.Controller/Drawing/ImageManager.cs b/MediaBrowser.Controller/Drawing/ImageManager.cs index 6bae3510ab..d78ff819bc 100644 --- a/MediaBrowser.Controller/Drawing/ImageManager.cs +++ b/MediaBrowser.Controller/Drawing/ImageManager.cs @@ -119,7 +119,7 @@ namespace MediaBrowser.Controller.Drawing { try { - originalImagePath = GetCroppedImage(originalImagePath, dateModified); + originalImagePath = await GetCroppedImage(originalImagePath, dateModified).ConfigureAwait(false); } catch (Exception ex) { @@ -433,7 +433,7 @@ namespace MediaBrowser.Controller.Drawing /// The original image path. /// The date modified. /// System.String. - private string GetCroppedImage(string originalImagePath, DateTime dateModified) + private async Task GetCroppedImage(string originalImagePath, DateTime dateModified) { var name = originalImagePath; name += "datemodified=" + dateModified.Ticks; @@ -450,10 +450,7 @@ namespace MediaBrowser.Controller.Drawing using (var croppedImage = originalImage.CropWhitespace()) { - using (var cacheFileStream = new FileStream(croppedImagePath, FileMode.Create)) - { - croppedImage.Save(outputFormat, cacheFileStream, 100); - } + await SaveImageToFile(croppedImage, outputFormat, croppedImagePath).ConfigureAwait(false); } } } @@ -462,6 +459,21 @@ namespace MediaBrowser.Controller.Drawing return croppedImagePath; } + private async Task SaveImageToFile(Image image, ImageFormat outputFormat, string file) + { + using (var memoryStream = new MemoryStream()) + { + image.Save(outputFormat, memoryStream, 100); + + memoryStream.Position = 0; + + using (var cacheFileStream = new FileStream(file, FileMode.Create, FileAccess.Write, FileShare.Read, StreamDefaults.DefaultFileStreamBufferSize, FileOptions.Asynchronous)) + { + await memoryStream.CopyToAsync(cacheFileStream).ConfigureAwait(false); + } + } + } + /// /// Runs an image through the image enhancers, caches the result, and returns the cached path /// @@ -507,7 +519,7 @@ namespace MediaBrowser.Controller.Drawing using (var newImage = await ExecuteImageEnhancers(supportedEnhancers, originalImage, item, imageType, imageIndex).ConfigureAwait(false)) { //And then save it in the cache - newImage.Save(enhancedImagePath, ImageFormat.Png); + await SaveImageToFile(newImage, ImageFormat.Png, enhancedImagePath).ConfigureAwait(false); } } } diff --git a/MediaBrowser.Installer/MediaBrowser.Installer.csproj b/MediaBrowser.Installer/MediaBrowser.Installer.csproj index f6f26cc595..a7cee973d5 100644 --- a/MediaBrowser.Installer/MediaBrowser.Installer.csproj +++ b/MediaBrowser.Installer/MediaBrowser.Installer.csproj @@ -82,8 +82,9 @@ False ..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll - - ..\packages\ServiceStack.Text.3.9.38\lib\net35\ServiceStack.Text.dll + + False + ..\packages\ServiceStack.Text.3.9.40\lib\net35\ServiceStack.Text.dll diff --git a/MediaBrowser.Installer/packages.config b/MediaBrowser.Installer/packages.config index e366bffa76..ecf23ce102 100644 --- a/MediaBrowser.Installer/packages.config +++ b/MediaBrowser.Installer/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj index 2bb75a18da..72f6d0b0fd 100644 --- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj +++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj @@ -45,35 +45,45 @@ ..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll - - ..\packages\ServiceStack.3.9.38\lib\net35\ServiceStack.dll + + False + ..\packages\ServiceStack.3.9.40\lib\net35\ServiceStack.dll - - ..\packages\ServiceStack.Api.Swagger.3.9.38\lib\net35\ServiceStack.Api.Swagger.dll + + False + ..\packages\ServiceStack.Api.Swagger.3.9.40\lib\net35\ServiceStack.Api.Swagger.dll - - ..\packages\ServiceStack.Common.3.9.38\lib\net35\ServiceStack.Common.dll + + False + ..\packages\ServiceStack.Common.3.9.40\lib\net35\ServiceStack.Common.dll - - ..\packages\ServiceStack.Common.3.9.38\lib\net35\ServiceStack.Interfaces.dll + + False + ..\packages\ServiceStack.Common.3.9.40\lib\net35\ServiceStack.Interfaces.dll - - ..\packages\ServiceStack.Logging.NLog.1.0.6.0\lib\net35\ServiceStack.Logging.NLog.dll + + False + ..\packages\ServiceStack.Logging.NLog.1.0.8.0\lib\net35\ServiceStack.Logging.NLog.dll - - ..\packages\ServiceStack.OrmLite.SqlServer.3.9.39\lib\ServiceStack.OrmLite.dll + + False + ..\packages\ServiceStack.OrmLite.SqlServer.3.9.41\lib\ServiceStack.OrmLite.dll - - ..\packages\ServiceStack.OrmLite.SqlServer.3.9.39\lib\ServiceStack.OrmLite.SqlServer.dll + + False + ..\packages\ServiceStack.OrmLite.SqlServer.3.9.41\lib\ServiceStack.OrmLite.SqlServer.dll - - ..\packages\ServiceStack.Redis.3.9.38\lib\net35\ServiceStack.Redis.dll + + False + ..\packages\ServiceStack.Redis.3.9.40\lib\net35\ServiceStack.Redis.dll - - ..\packages\ServiceStack.3.9.38\lib\net35\ServiceStack.ServiceInterface.dll + + False + ..\packages\ServiceStack.3.9.40\lib\net35\ServiceStack.ServiceInterface.dll - - ..\packages\ServiceStack.Text.3.9.38\lib\net35\ServiceStack.Text.dll + + False + ..\packages\ServiceStack.Text.3.9.40\lib\net35\ServiceStack.Text.dll diff --git a/MediaBrowser.Server.Implementations/packages.config b/MediaBrowser.Server.Implementations/packages.config index 002d5974e3..576fbb438f 100644 --- a/MediaBrowser.Server.Implementations/packages.config +++ b/MediaBrowser.Server.Implementations/packages.config @@ -7,12 +7,12 @@ - - - - - - - + + + + + + + \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index ca223f63bc..eac4a3e8f2 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -35,37 +35,37 @@ Always - + False - ..\packages\ServiceStack.3.9.38\lib\net35\ServiceStack.dll + ..\packages\ServiceStack.3.9.40\lib\net35\ServiceStack.dll - + False - ..\packages\ServiceStack.Common.3.9.38\lib\net35\ServiceStack.Common.dll + ..\packages\ServiceStack.Common.3.9.40\lib\net35\ServiceStack.Common.dll - + False - ..\packages\ServiceStack.Common.3.9.38\lib\net35\ServiceStack.Interfaces.dll + ..\packages\ServiceStack.Common.3.9.40\lib\net35\ServiceStack.Interfaces.dll - + False - ..\packages\ServiceStack.OrmLite.SqlServer.3.9.39\lib\ServiceStack.OrmLite.dll + ..\packages\ServiceStack.OrmLite.SqlServer.3.9.41\lib\ServiceStack.OrmLite.dll False - ..\packages\ServiceStack.OrmLite.SqlServer.3.9.39\lib\ServiceStack.OrmLite.SqlServer.dll + ..\packages\ServiceStack.OrmLite.SqlServer.3.9.41\lib\ServiceStack.OrmLite.SqlServer.dll - + False - ..\packages\ServiceStack.Redis.3.9.38\lib\net35\ServiceStack.Redis.dll + ..\packages\ServiceStack.Redis.3.9.40\lib\net35\ServiceStack.Redis.dll False - ..\packages\ServiceStack.3.9.38\lib\net35\ServiceStack.ServiceInterface.dll + ..\packages\ServiceStack.3.9.40\lib\net35\ServiceStack.ServiceInterface.dll - + False - ..\packages\ServiceStack.Text.3.9.38\lib\net35\ServiceStack.Text.dll + ..\packages\ServiceStack.Text.3.9.40\lib\net35\ServiceStack.Text.dll diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config index 4feeb5bac9..ca2a7a8d23 100644 --- a/MediaBrowser.WebDashboard/packages.config +++ b/MediaBrowser.WebDashboard/packages.config @@ -1,9 +1,9 @@  - - - - - + + + + + \ No newline at end of file