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