mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-19 20:54:20 +01:00
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
This commit is contained in:
@@ -576,6 +576,41 @@ namespace MediaBrowser.Controller.Drawing
|
||||
return croppedImagePath;
|
||||
}
|
||||
|
||||
/// <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>
|
||||
|
||||
@@ -28,19 +28,14 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Configuration.UseCustomLibrary)
|
||||
var path = Configuration.UseCustomLibrary ? GetRootFolderPath(Name) : ConfigurationManager.ApplicationPaths.DefaultUserViewsPath;
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
var rootFolderPath = GetRootFolderPath(Name);
|
||||
|
||||
if (!Directory.Exists(rootFolderPath))
|
||||
{
|
||||
Directory.CreateDirectory(rootFolderPath);
|
||||
}
|
||||
|
||||
return rootFolderPath;
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
return ConfigurationManager.ApplicationPaths.DefaultUserViewsPath;
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user