diff options
| author | Eric Reed <ebr@mediabrowser3.com> | 2013-06-04 13:24:44 -0400 |
|---|---|---|
| committer | Eric Reed <ebr@mediabrowser3.com> | 2013-06-04 13:24:44 -0400 |
| commit | c21c678ed9b987f08478d218094cd5b20f7f560e (patch) | |
| tree | 27f10b0fffd2d3fcf73997d190625efe0b291b0d /MediaBrowser.Controller | |
| parent | 4e5186ef0be7e52041823faf02fc0d157cccfa7d (diff) | |
| parent | 25cc19a10b13e05f2fa2bd89f9da649bbcd6bd31 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Drawing/ImageManager.cs | 35 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/User.cs | 15 |
2 files changed, 40 insertions, 10 deletions
diff --git a/MediaBrowser.Controller/Drawing/ImageManager.cs b/MediaBrowser.Controller/Drawing/ImageManager.cs index b8406438c9..14994ac5ce 100644 --- a/MediaBrowser.Controller/Drawing/ImageManager.cs +++ b/MediaBrowser.Controller/Drawing/ImageManager.cs @@ -577,6 +577,41 @@ namespace MediaBrowser.Controller.Drawing } /// <summary> + /// Gets the enhanced image. + /// </summary> + /// <param name="originalImagePath">The original image path.</param> + /// <param name="dateModified">The date modified.</param> + /// <param name="item">The item.</param> + /// <param name="imageType">Type of the image.</param> + /// <param name="imageIndex">Index of the image.</param> + /// <returns>Task{System.String}.</returns> + /// <exception cref="System.ArgumentNullException">item</exception> + public Task<string> GetEnhancedImage(string originalImagePath, DateTime dateModified, BaseItem item, ImageType imageType, int imageIndex) + { + if (item == null) + { + throw new ArgumentNullException("item"); + } + + var supportedImageEnhancers = ImageEnhancers.Where(i => + { + try + { + return i.Supports(item, imageType); + } + catch (Exception ex) + { + _logger.ErrorException("Error in image enhancer: {0}", ex, i.GetType().Name); + + return false; + } + + }).ToList(); + + return GetEnhancedImage(originalImagePath, dateModified, item, imageType, imageIndex, supportedImageEnhancers); + } + + /// <summary> /// Runs an image through the image enhancers, caches the result, and returns the cached path /// </summary> /// <param name="originalImagePath">The original image path.</param> diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index 65884332aa..e991820e3e 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -28,19 +28,14 @@ namespace MediaBrowser.Controller.Entities { get { - if (Configuration.UseCustomLibrary) - { - var rootFolderPath = GetRootFolderPath(Name); + var path = Configuration.UseCustomLibrary ? GetRootFolderPath(Name) : ConfigurationManager.ApplicationPaths.DefaultUserViewsPath; - if (!Directory.Exists(rootFolderPath)) - { - Directory.CreateDirectory(rootFolderPath); - } - - return rootFolderPath; + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); } - return ConfigurationManager.ApplicationPaths.DefaultUserViewsPath; + return path; } } |
