mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-16 02:18:54 -07:00
853ef727da
Fixes #7040
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
#pragma warning disable CA1819, CS1591
|
|
|
|
using System;
|
|
using System.Linq;
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
namespace MediaBrowser.Controller.Providers
|
|
{
|
|
public class ImageRefreshOptions
|
|
{
|
|
public ImageRefreshOptions(IDirectoryService directoryService)
|
|
{
|
|
ImageRefreshMode = MetadataRefreshMode.Default;
|
|
DirectoryService = directoryService;
|
|
|
|
ReplaceImages = Array.Empty<ImageType>();
|
|
IsAutomated = true;
|
|
}
|
|
|
|
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; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether the action is an identify.
|
|
/// </summary>
|
|
public bool IsIdentify { get; set; }
|
|
|
|
public bool IsReplacingImage(ImageType type)
|
|
{
|
|
return ImageRefreshMode == MetadataRefreshMode.FullRefresh &&
|
|
(ReplaceAllImages || ReplaceImages.Contains(type));
|
|
}
|
|
}
|
|
}
|