jellyfin/MediaBrowser.Controller/Drawing/ImageProcessorExtensions.cs
2020-05-12 22:10:35 -04:00

27 lines
805 B
C#

using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities;
using User = Jellyfin.Data.Entities.User;
namespace MediaBrowser.Controller.Drawing
{
public static class ImageProcessorExtensions
{
public static string GetImageCacheTag(this IImageProcessor processor, BaseItem item, ImageType imageType)
{
return processor.GetImageCacheTag(item, imageType, 0);
}
public static string GetImageCacheTag(this IImageProcessor processor, BaseItem item, ImageType imageType, int imageIndex)
{
var imageInfo = item.GetImageInfo(imageType, imageIndex);
if (imageInfo == null)
{
return null;
}
return processor.GetImageCacheTag(item, imageInfo);
}
}
}