diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-10 09:41:24 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-10 09:41:24 -0500 |
| commit | 227dd0a42d398978ca085a607345a7877de87950 (patch) | |
| tree | 19f3d394d5be259fd32ea04e4f966082372e1715 /MediaBrowser.Api/Images/ImageByNameService.cs | |
| parent | c1ae3ec2ce803b16fa9ecc0981865aa7c9be172b (diff) | |
rework result factory
Diffstat (limited to 'MediaBrowser.Api/Images/ImageByNameService.cs')
| -rw-r--r-- | MediaBrowser.Api/Images/ImageByNameService.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/MediaBrowser.Api/Images/ImageByNameService.cs b/MediaBrowser.Api/Images/ImageByNameService.cs index e0a9246c1..8fbc56ce3 100644 --- a/MediaBrowser.Api/Images/ImageByNameService.cs +++ b/MediaBrowser.Api/Images/ImageByNameService.cs @@ -102,15 +102,17 @@ namespace MediaBrowser.Api.Images private readonly IServerApplicationPaths _appPaths; private readonly IFileSystem _fileSystem; + private readonly IHttpResultFactory _resultFactory; /// <summary> /// Initializes a new instance of the <see cref="ImageByNameService" /> class. /// </summary> /// <param name="appPaths">The app paths.</param> - public ImageByNameService(IServerApplicationPaths appPaths, IFileSystem fileSystem) + public ImageByNameService(IServerApplicationPaths appPaths, IFileSystem fileSystem, IHttpResultFactory resultFactory) { _appPaths = appPaths; _fileSystem = fileSystem; + _resultFactory = resultFactory; } public object Get(GetMediaInfoImages request) @@ -187,7 +189,7 @@ namespace MediaBrowser.Api.Images var path = paths.FirstOrDefault(_fileSystem.FileExists) ?? paths.FirstOrDefault(); - return ToStaticFileResult(path); + return _resultFactory.GetStaticFileResult(Request, path); } /// <summary> @@ -207,7 +209,7 @@ namespace MediaBrowser.Api.Images if (!string.IsNullOrEmpty(path)) { - return ToStaticFileResult(path); + return _resultFactory.GetStaticFileResult(Request, path); } } @@ -224,7 +226,7 @@ namespace MediaBrowser.Api.Images if (!string.IsNullOrEmpty(path)) { - return ToStaticFileResult(path); + return _resultFactory.GetStaticFileResult(Request, path); } } @@ -247,7 +249,7 @@ namespace MediaBrowser.Api.Images if (!string.IsNullOrEmpty(path)) { - return ToStaticFileResult(path); + return _resultFactory.GetStaticFileResult(Request, path); } } @@ -263,7 +265,7 @@ namespace MediaBrowser.Api.Images if (!string.IsNullOrEmpty(path)) { - return ToStaticFileResult(path); + return _resultFactory.GetStaticFileResult(Request, path); } } |
