jellyfin/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs

33 lines
965 B
C#
Raw Normal View History

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 MetadataRefreshMode ImageRefreshMode { get; set; }
public IDirectoryService DirectoryService { get; private set; }
public bool ReplaceAllImages { get; set; }
public ImageType[] ReplaceImages { get; set; }
public bool IsAutomated { get; set; }
public ImageRefreshOptions(IDirectoryService directoryService)
{
ImageRefreshMode = MetadataRefreshMode.Default;
DirectoryService = directoryService;
2018-12-27 21:43:48 +00:00
ReplaceImages = Array.Empty<ImageType>();
2018-12-27 23:27:57 +00:00
IsAutomated = true;
}
public bool IsReplacingImage(ImageType type)
{
return ImageRefreshMode == MetadataRefreshMode.FullRefresh &&
(ReplaceAllImages || ReplaceImages.Contains(type));
}
}
2018-12-27 21:43:48 +00:00
}