update action sheet

pull/702/head
Luke Pulverenti 9 years ago
parent 467c2a7901
commit b01780a9b7

@ -1,6 +1,5 @@
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
@ -14,6 +13,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using CommonIO;
using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Server.Implementations.Photos
{
@ -47,6 +47,41 @@ namespace MediaBrowser.Server.Implementations.Photos
};
}
private IEnumerable<ImageType> GetEnabledImages(IHasImages item)
{
//var options = ProviderManager.GetMetadataOptions(item);
return GetSupportedImages(item);
//return GetSupportedImages(item).Where(i => IsEnabled(options, i, item)).ToList();
}
private bool IsEnabled(MetadataOptions options, ImageType type, IHasImages item)
{
if (type == ImageType.Backdrop)
{
if (item.LockedFields.Contains(MetadataFields.Backdrops))
{
return false;
}
}
else if (type == ImageType.Screenshot)
{
if (item.LockedFields.Contains(MetadataFields.Screenshots))
{
return false;
}
}
else
{
if (item.LockedFields.Contains(MetadataFields.Images))
{
return false;
}
}
return options.IsEnabled(type);
}
public async Task<ItemUpdateType> FetchAsync(T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
if (!Supports(item))
@ -55,7 +90,7 @@ namespace MediaBrowser.Server.Implementations.Photos
}
var updateType = ItemUpdateType.None;
var supportedImages = GetSupportedImages(item).ToList();
var supportedImages = GetEnabledImages(item).ToList();
if (supportedImages.Contains(ImageType.Primary))
{
@ -69,7 +104,6 @@ namespace MediaBrowser.Server.Implementations.Photos
updateType = updateType | thumbResult;
}
return updateType;
}
@ -220,7 +254,7 @@ namespace MediaBrowser.Server.Implementations.Photos
return false;
}
var supportedImages = GetSupportedImages(item).ToList();
var supportedImages = GetEnabledImages(item).ToList();
if (supportedImages.Contains(ImageType.Primary) && HasChanged(item, ImageType.Primary))
{

Loading…
Cancel
Save