jellyfin-server/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs

42 lines
1.1 KiB
C#
Raw Normal View History

#pragma warning disable CA1819, CS1591
2018-12-27 23:27:57 +00:00
using System;
using System.Linq;
using MediaBrowser.Model.Entities;
2018-12-27 23:27:57 +00:00
namespace MediaBrowser.Controller.Providers
{
public class ImageRefreshOptions
{
public ImageRefreshOptions(IDirectoryService directoryService)
{
ImageRefreshMode = MetadataRefreshMode.Default;
DirectoryService = directoryService;
ReplaceImages = Array.Empty<ImageType>();
IsAutomated = true;
}
2018-12-27 23:27:57 +00:00
public MetadataRefreshMode ImageRefreshMode { get; set; }
2020-06-15 21:43:52 +00:00
2018-12-27 23:27:57 +00:00
public IDirectoryService DirectoryService { get; private set; }
public bool ReplaceAllImages { get; set; }
public ImageType[] ReplaceImages { get; set; }
2020-06-15 21:43:52 +00:00
2018-12-27 23:27:57 +00:00
public bool IsAutomated { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the action is an identify.
/// </summary>
public bool IsIdentify { get; set; }
2018-12-27 23:27:57 +00:00
public bool IsReplacingImage(ImageType type)
{
return ImageRefreshMode == MetadataRefreshMode.FullRefresh &&
(ReplaceAllImages || ReplaceImages.Contains(type));
}
}
2018-12-27 21:43:48 +00:00
}