You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs

43 lines
1.2 KiB

#pragma warning disable CA1819, CS1591
6 years ago
using System;
using System.Collections.Generic;
6 years ago
using System.Linq;
using MediaBrowser.Model.Entities;
6 years ago
namespace MediaBrowser.Controller.Providers
{
public class ImageRefreshOptions
{
public ImageRefreshOptions(IDirectoryService directoryService)
{
ImageRefreshMode = MetadataRefreshMode.Default;
DirectoryService = directoryService;
ReplaceImages = Array.Empty<ImageType>();
IsAutomated = true;
}
6 years ago
public MetadataRefreshMode ImageRefreshMode { get; set; }
6 years ago
public IDirectoryService DirectoryService { get; private set; }
public bool ReplaceAllImages { get; set; }
public IReadOnlyList<ImageType> ReplaceImages { get; set; }
6 years ago
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; }
6 years ago
public bool IsReplacingImage(ImageType type)
{
return ImageRefreshMode == MetadataRefreshMode.FullRefresh
&& (ReplaceAllImages || ReplaceImages.Contains(type));
6 years ago
}
}
6 years ago
}