jellyfin/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs
Bond-009 6702756e7b Merge pull request #7873 from cvium/fix_nfo_remoteimages
(cherry picked from commit 1a787e273a)
Signed-off-by: crobibero <cody@robibe.ro>
2022-06-14 19:30:59 -04:00

42 lines
1.2 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 old metadata should be removed if it isn't replaced.
/// </summary>
public bool RemoveOldMetadata { get; set; }
public bool IsReplacingImage(ImageType type)
{
return ImageRefreshMode == MetadataRefreshMode.FullRefresh
&& (ReplaceAllImages || ReplaceImages.Contains(type));
}
}
}