2021-05-06 15:39:20 -07:00
|
|
|
#nullable disable
|
|
|
|
|
2020-08-22 12:56:24 -07:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2018-12-27 16:27:57 -07:00
|
|
|
using System;
|
|
|
|
using System.Linq;
|
2019-01-13 12:25:32 -07:00
|
|
|
using MediaBrowser.Model.Entities;
|
2018-12-27 16:27:57 -07:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Providers
|
|
|
|
{
|
|
|
|
public class ImageRefreshOptions
|
|
|
|
{
|
|
|
|
public MetadataRefreshMode ImageRefreshMode { get; set; }
|
2020-06-15 14:43:52 -07:00
|
|
|
|
2018-12-27 16:27:57 -07:00
|
|
|
public IDirectoryService DirectoryService { get; private set; }
|
|
|
|
|
|
|
|
public bool ReplaceAllImages { get; set; }
|
|
|
|
|
|
|
|
public ImageType[] ReplaceImages { get; set; }
|
2020-06-15 14:43:52 -07:00
|
|
|
|
2018-12-27 16:27:57 -07:00
|
|
|
public bool IsAutomated { get; set; }
|
|
|
|
|
|
|
|
public ImageRefreshOptions(IDirectoryService directoryService)
|
|
|
|
{
|
|
|
|
ImageRefreshMode = MetadataRefreshMode.Default;
|
|
|
|
DirectoryService = directoryService;
|
|
|
|
|
2018-12-27 14:43:48 -07:00
|
|
|
ReplaceImages = Array.Empty<ImageType>();
|
2018-12-27 16:27:57 -07:00
|
|
|
IsAutomated = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool IsReplacingImage(ImageType type)
|
|
|
|
{
|
|
|
|
return ImageRefreshMode == MetadataRefreshMode.FullRefresh &&
|
|
|
|
(ReplaceAllImages || ReplaceImages.Contains(type));
|
|
|
|
}
|
|
|
|
}
|
2018-12-27 14:43:48 -07:00
|
|
|
}
|