mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 14:03:03 +03:00
Some style fixes
This commit is contained in:
@@ -21,14 +21,6 @@ namespace Emby.Server.Implementations.Images
|
||||
public abstract class BaseDynamicImageProvider<T> : IHasItemChangeMonitor, IForcedProvider, ICustomMetadataProvider<T>, IHasOrder
|
||||
where T : BaseItem
|
||||
{
|
||||
protected virtual IReadOnlyCollection<ImageType> SupportedImages { get; }
|
||||
= new ImageType[] { ImageType.Primary };
|
||||
|
||||
protected IFileSystem FileSystem { get; private set; }
|
||||
protected IProviderManager ProviderManager { get; private set; }
|
||||
protected IApplicationPaths ApplicationPaths { get; private set; }
|
||||
protected IImageProcessor ImageProcessor { get; set; }
|
||||
|
||||
protected BaseDynamicImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor)
|
||||
{
|
||||
ApplicationPaths = applicationPaths;
|
||||
@@ -37,6 +29,24 @@ namespace Emby.Server.Implementations.Images
|
||||
ImageProcessor = imageProcessor;
|
||||
}
|
||||
|
||||
protected IFileSystem FileSystem { get; }
|
||||
|
||||
protected IProviderManager ProviderManager { get; }
|
||||
|
||||
protected IApplicationPaths ApplicationPaths { get; }
|
||||
|
||||
protected IImageProcessor ImageProcessor { get; set; }
|
||||
|
||||
protected virtual IReadOnlyCollection<ImageType> SupportedImages { get; }
|
||||
= new ImageType[] { ImageType.Primary };
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name => "Dynamic Image Provider";
|
||||
|
||||
protected virtual int MaxImageAgeDays => 7;
|
||||
|
||||
public int Order => 0;
|
||||
|
||||
protected virtual bool Supports(BaseItem _) => true;
|
||||
|
||||
public async Task<ItemUpdateType> FetchAsync(T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
|
||||
@@ -85,7 +95,8 @@ namespace Emby.Server.Implementations.Images
|
||||
return FetchToFileInternal(item, items, imageType, cancellationToken);
|
||||
}
|
||||
|
||||
protected async Task<ItemUpdateType> FetchToFileInternal(BaseItem item,
|
||||
protected async Task<ItemUpdateType> FetchToFileInternal(
|
||||
BaseItem item,
|
||||
IReadOnlyList<BaseItem> itemsWithImages,
|
||||
ImageType imageType,
|
||||
CancellationToken cancellationToken)
|
||||
@@ -181,8 +192,6 @@ namespace Emby.Server.Implementations.Images
|
||||
return outputPath;
|
||||
}
|
||||
|
||||
public string Name => "Dynamic Image Provider";
|
||||
|
||||
protected virtual string CreateImage(BaseItem item,
|
||||
IReadOnlyCollection<BaseItem> itemsWithImages,
|
||||
string outputPathWithoutExtension,
|
||||
@@ -214,8 +223,6 @@ namespace Emby.Server.Implementations.Images
|
||||
throw new ArgumentException("Unexpected image type", nameof(imageType));
|
||||
}
|
||||
|
||||
protected virtual int MaxImageAgeDays => 7;
|
||||
|
||||
public bool HasChanged(BaseItem item, IDirectoryService directoryServicee)
|
||||
{
|
||||
if (!Supports(item))
|
||||
@@ -263,15 +270,9 @@ namespace Emby.Server.Implementations.Images
|
||||
protected virtual bool HasChangedByDate(BaseItem item, ItemImageInfo image)
|
||||
{
|
||||
var age = DateTime.UtcNow - image.DateModified;
|
||||
if (age.TotalDays <= MaxImageAgeDays)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return age.TotalDays > MaxImageAgeDays;
|
||||
}
|
||||
|
||||
public int Order => 0;
|
||||
|
||||
protected string CreateSingleImage(IEnumerable<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType)
|
||||
{
|
||||
var image = itemsWithImages
|
||||
|
||||
Reference in New Issue
Block a user