consolidate interfaces
This commit is contained in:
parent
cc679f3561
commit
52aeb3c40b
|
@ -186,7 +186,7 @@ namespace Emby.Drawing
|
|||
}
|
||||
|
||||
var originalImage = options.Image;
|
||||
IHasImages item = options.Item;
|
||||
IHasMetadata item = options.Item;
|
||||
|
||||
if (!originalImage.IsLocalFile)
|
||||
{
|
||||
|
@ -606,7 +606,7 @@ namespace Emby.Drawing
|
|||
/// <param name="image">The image.</param>
|
||||
/// <returns>Guid.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">item</exception>
|
||||
public string GetImageCacheTag(IHasImages item, ItemImageInfo image)
|
||||
public string GetImageCacheTag(IHasMetadata item, ItemImageInfo image)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
|
@ -631,7 +631,7 @@ namespace Emby.Drawing
|
|||
/// <param name="imageEnhancers">The image enhancers.</param>
|
||||
/// <returns>Guid.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">item</exception>
|
||||
public string GetImageCacheTag(IHasImages item, ItemImageInfo image, List<IImageEnhancer> imageEnhancers)
|
||||
public string GetImageCacheTag(IHasMetadata item, ItemImageInfo image, List<IImageEnhancer> imageEnhancers)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
|
@ -672,7 +672,7 @@ namespace Emby.Drawing
|
|||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <returns>Task{System.String}.</returns>
|
||||
public async Task<string> GetEnhancedImage(IHasImages item, ImageType imageType, int imageIndex)
|
||||
public async Task<string> GetEnhancedImage(IHasMetadata item, ImageType imageType, int imageIndex)
|
||||
{
|
||||
var enhancers = GetSupportedEnhancers(item, imageType).ToList();
|
||||
|
||||
|
@ -684,7 +684,7 @@ namespace Emby.Drawing
|
|||
}
|
||||
|
||||
private async Task<Tuple<string, DateTime>> GetEnhancedImage(ItemImageInfo image,
|
||||
IHasImages item,
|
||||
IHasMetadata item,
|
||||
int imageIndex,
|
||||
List<IImageEnhancer> enhancers)
|
||||
{
|
||||
|
@ -729,7 +729,7 @@ namespace Emby.Drawing
|
|||
/// item
|
||||
/// </exception>
|
||||
private async Task<string> GetEnhancedImageInternal(string originalImagePath,
|
||||
IHasImages item,
|
||||
IHasMetadata item,
|
||||
ImageType imageType,
|
||||
int imageIndex,
|
||||
IEnumerable<IImageEnhancer> supportedEnhancers,
|
||||
|
@ -783,7 +783,7 @@ namespace Emby.Drawing
|
|||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <returns>Task{EnhancedImage}.</returns>
|
||||
private async Task ExecuteImageEnhancers(IEnumerable<IImageEnhancer> imageEnhancers, string inputPath, string outputPath, IHasImages item, ImageType imageType, int imageIndex)
|
||||
private async Task ExecuteImageEnhancers(IEnumerable<IImageEnhancer> imageEnhancers, string inputPath, string outputPath, IHasMetadata item, ImageType imageType, int imageIndex)
|
||||
{
|
||||
// Run the enhancers sequentially in order of priority
|
||||
foreach (var enhancer in imageEnhancers)
|
||||
|
@ -868,7 +868,7 @@ namespace Emby.Drawing
|
|||
_logger.Info("Completed creation of image collage and saved to {0}", options.OutputPath);
|
||||
}
|
||||
|
||||
public IEnumerable<IImageEnhancer> GetSupportedEnhancers(IHasImages item, ImageType imageType)
|
||||
public IEnumerable<IImageEnhancer> GetSupportedEnhancers(IHasMetadata item, ImageType imageType)
|
||||
{
|
||||
return ImageEnhancers.Where(i =>
|
||||
{
|
||||
|
|
|
@ -18,12 +18,12 @@ namespace Emby.Server.Implementations.Channels
|
|||
_channelManager = channelManager;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return GetChannel(item).GetSupportedChannelImages();
|
||||
}
|
||||
|
||||
public Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken)
|
||||
public Task<DynamicImageResponse> GetImage(IHasMetadata item, ImageType type, CancellationToken cancellationToken)
|
||||
{
|
||||
var channel = GetChannel(item);
|
||||
|
||||
|
@ -35,12 +35,12 @@ namespace Emby.Server.Implementations.Channels
|
|||
get { return "Channel Image Provider"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Channel;
|
||||
}
|
||||
|
||||
private IChannel GetChannel(IHasImages item)
|
||||
private IChannel GetChannel(IHasMetadata item)
|
||||
{
|
||||
var channel = (Channel)item;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace Emby.Server.Implementations.Collections
|
|||
{
|
||||
}
|
||||
|
||||
protected override bool Supports(IHasImages item)
|
||||
protected override bool Supports(IHasMetadata item)
|
||||
{
|
||||
// Right now this is the only way to prevent this image from getting created ahead of internet image providers
|
||||
if (!item.IsLocked)
|
||||
|
@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.Collections
|
|||
return base.Supports(item);
|
||||
}
|
||||
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasImages item)
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasMetadata item)
|
||||
{
|
||||
var playlist = (BoxSet)item;
|
||||
|
||||
|
@ -76,7 +76,7 @@ namespace Emby.Server.Implementations.Collections
|
|||
return GetFinalItems(items, 2);
|
||||
}
|
||||
|
||||
protected override string CreateImage(IHasImages item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
protected override string CreateImage(IHasMetadata item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
{
|
||||
return CreateSingleImage(itemsWithImages, outputPathWithoutExtension, ImageType.Primary);
|
||||
}
|
||||
|
|
|
@ -1581,12 +1581,12 @@ namespace Emby.Server.Implementations.Dto
|
|||
/// <param name="dto">The dto.</param>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <returns>Task.</returns>
|
||||
public void AttachPrimaryImageAspectRatio(IItemDto dto, IHasImages item)
|
||||
public void AttachPrimaryImageAspectRatio(IItemDto dto, IHasMetadata item)
|
||||
{
|
||||
dto.PrimaryImageAspectRatio = GetPrimaryImageAspectRatio(item);
|
||||
}
|
||||
|
||||
public double? GetPrimaryImageAspectRatio(IHasImages item)
|
||||
public double? GetPrimaryImageAspectRatio(IHasMetadata item)
|
||||
{
|
||||
var imageInfo = item.GetImageInfo(ImageType.Primary, 0);
|
||||
|
||||
|
|
|
@ -37,12 +37,12 @@ namespace Emby.Server.Implementations.Images
|
|||
ImageProcessor = imageProcessor;
|
||||
}
|
||||
|
||||
protected virtual bool Supports(IHasImages item)
|
||||
protected virtual bool Supports(IHasMetadata item)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public virtual IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ namespace Emby.Server.Implementations.Images
|
|||
};
|
||||
}
|
||||
|
||||
private IEnumerable<ImageType> GetEnabledImages(IHasImages item)
|
||||
private IEnumerable<ImageType> GetEnabledImages(IHasMetadata item)
|
||||
{
|
||||
//var options = ProviderManager.GetMetadataOptions(item);
|
||||
|
||||
|
@ -84,7 +84,7 @@ namespace Emby.Server.Implementations.Images
|
|||
return updateType;
|
||||
}
|
||||
|
||||
protected async Task<ItemUpdateType> FetchAsync(IHasImages item, ImageType imageType, MetadataRefreshOptions options, CancellationToken cancellationToken)
|
||||
protected async Task<ItemUpdateType> FetchAsync(IHasMetadata item, ImageType imageType, MetadataRefreshOptions options, CancellationToken cancellationToken)
|
||||
{
|
||||
var image = item.GetImageInfo(imageType, 0);
|
||||
|
||||
|
@ -106,7 +106,7 @@ namespace Emby.Server.Implementations.Images
|
|||
return await FetchToFileInternal(item, items, imageType, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
protected async Task<ItemUpdateType> FetchToFileInternal(IHasImages item,
|
||||
protected async Task<ItemUpdateType> FetchToFileInternal(IHasMetadata item,
|
||||
List<BaseItem> itemsWithImages,
|
||||
ImageType imageType,
|
||||
CancellationToken cancellationToken)
|
||||
|
@ -132,14 +132,14 @@ namespace Emby.Server.Implementations.Images
|
|||
return ItemUpdateType.ImageUpdate;
|
||||
}
|
||||
|
||||
protected abstract List<BaseItem> GetItemsWithImages(IHasImages item);
|
||||
protected abstract List<BaseItem> GetItemsWithImages(IHasMetadata item);
|
||||
|
||||
protected string CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath)
|
||||
protected string CreateThumbCollage(IHasMetadata primaryItem, List<BaseItem> items, string outputPath)
|
||||
{
|
||||
return CreateCollage(primaryItem, items, outputPath, 640, 360);
|
||||
}
|
||||
|
||||
protected virtual IEnumerable<string> GetStripCollageImagePaths(IHasImages primaryItem, IEnumerable<BaseItem> items)
|
||||
protected virtual IEnumerable<string> GetStripCollageImagePaths(IHasMetadata primaryItem, IEnumerable<BaseItem> items)
|
||||
{
|
||||
return items
|
||||
.Select(i =>
|
||||
|
@ -161,22 +161,22 @@ namespace Emby.Server.Implementations.Images
|
|||
.Where(i => !string.IsNullOrWhiteSpace(i));
|
||||
}
|
||||
|
||||
protected string CreatePosterCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath)
|
||||
protected string CreatePosterCollage(IHasMetadata primaryItem, List<BaseItem> items, string outputPath)
|
||||
{
|
||||
return CreateCollage(primaryItem, items, outputPath, 400, 600);
|
||||
}
|
||||
|
||||
protected string CreateSquareCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath)
|
||||
protected string CreateSquareCollage(IHasMetadata primaryItem, List<BaseItem> items, string outputPath)
|
||||
{
|
||||
return CreateCollage(primaryItem, items, outputPath, 600, 600);
|
||||
}
|
||||
|
||||
protected string CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, int width, int height)
|
||||
protected string CreateThumbCollage(IHasMetadata primaryItem, List<BaseItem> items, string outputPath, int width, int height)
|
||||
{
|
||||
return CreateCollage(primaryItem, items, outputPath, width, height);
|
||||
}
|
||||
|
||||
private string CreateCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, int width, int height)
|
||||
private string CreateCollage(IHasMetadata primaryItem, List<BaseItem> items, string outputPath, int width, int height)
|
||||
{
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(outputPath));
|
||||
|
||||
|
@ -207,7 +207,7 @@ namespace Emby.Server.Implementations.Images
|
|||
get { return "Dynamic Image Provider"; }
|
||||
}
|
||||
|
||||
protected virtual string CreateImage(IHasImages item,
|
||||
protected virtual string CreateImage(IHasMetadata item,
|
||||
List<BaseItem> itemsWithImages,
|
||||
string outputPathWithoutExtension,
|
||||
ImageType imageType,
|
||||
|
@ -267,7 +267,7 @@ namespace Emby.Server.Implementations.Images
|
|||
return false;
|
||||
}
|
||||
|
||||
protected bool HasChanged(IHasImages item, ImageType type)
|
||||
protected bool HasChanged(IHasMetadata item, ImageType type)
|
||||
{
|
||||
var image = item.GetImageInfo(type, 0);
|
||||
|
||||
|
|
|
@ -2856,7 +2856,7 @@ namespace Emby.Server.Implementations.Library
|
|||
return ItemRepository.UpdatePeople(item.Id, people);
|
||||
}
|
||||
|
||||
public async Task<ItemImageInfo> ConvertImageToLocal(IHasImages item, ItemImageInfo image, int imageIndex)
|
||||
public async Task<ItemImageInfo> ConvertImageToLocal(IHasMetadata item, ItemImageInfo image, int imageIndex)
|
||||
{
|
||||
foreach (var url in image.Path.Split('|'))
|
||||
{
|
||||
|
|
|
@ -28,12 +28,12 @@ namespace Emby.Server.Implementations.LiveTv
|
|||
_appHost = appHost;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new[] { ImageType.Primary };
|
||||
}
|
||||
|
||||
public async Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken)
|
||||
public async Task<DynamicImageResponse> GetImage(IHasMetadata item, ImageType type, CancellationToken cancellationToken)
|
||||
{
|
||||
var liveTvItem = (LiveTvChannel)item;
|
||||
|
||||
|
@ -67,7 +67,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||
get { return "Live TV Service Provider"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is LiveTvChannel;
|
||||
}
|
||||
|
|
|
@ -406,7 +406,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||
return dto;
|
||||
}
|
||||
|
||||
internal string GetImageTag(IHasImages info)
|
||||
internal string GetImageTag(IHasMetadata info)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -19,12 +19,12 @@ namespace Emby.Server.Implementations.LiveTv
|
|||
_liveTvManager = liveTvManager;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new[] { ImageType.Primary };
|
||||
}
|
||||
|
||||
public async Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken)
|
||||
public async Task<DynamicImageResponse> GetImage(IHasMetadata item, ImageType type, CancellationToken cancellationToken)
|
||||
{
|
||||
var liveTvItem = (ILiveTvRecording)item;
|
||||
|
||||
|
@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||
get { return "Live TV Service Provider"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is ILiveTvRecording;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace Emby.Server.Implementations.MediaEncoder
|
|||
/// Gets the chapter images data path.
|
||||
/// </summary>
|
||||
/// <value>The chapter images data path.</value>
|
||||
private string GetChapterImagesPath(IHasImages item)
|
||||
private string GetChapterImagesPath(IHasMetadata item)
|
||||
{
|
||||
return Path.Combine(item.GetInternalMetadataPath(), "chapters");
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Emby.Server.Implementations.Photos
|
|||
{
|
||||
}
|
||||
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasImages item)
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasMetadata item)
|
||||
{
|
||||
var photoAlbum = (PhotoAlbum)item;
|
||||
var items = GetFinalItems(photoAlbum.Children.ToList());
|
||||
|
@ -26,7 +26,7 @@ namespace Emby.Server.Implementations.Photos
|
|||
return items;
|
||||
}
|
||||
|
||||
protected override string CreateImage(IHasImages item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
protected override string CreateImage(IHasMetadata item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
{
|
||||
return CreateSingleImage(itemsWithImages, outputPathWithoutExtension, ImageType.Primary);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||
{
|
||||
}
|
||||
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasImages item)
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasMetadata item)
|
||||
{
|
||||
var playlist = (Playlist)item;
|
||||
|
||||
|
@ -81,7 +81,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasImages item)
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasMetadata item)
|
||||
{
|
||||
var items = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
|
@ -98,7 +98,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||
return GetFinalItems(items);
|
||||
}
|
||||
|
||||
//protected override Task<string> CreateImage(IHasImages item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
//protected override Task<string> CreateImage(IHasMetadata item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
//{
|
||||
// return CreateSingleImage(itemsWithImages, outputPathWithoutExtension, ImageType.Primary);
|
||||
//}
|
||||
|
@ -113,7 +113,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasImages item)
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasMetadata item)
|
||||
{
|
||||
var items = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
|
@ -130,7 +130,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||
return GetFinalItems(items);
|
||||
}
|
||||
|
||||
//protected override Task<string> CreateImage(IHasImages item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
//protected override Task<string> CreateImage(IHasMetadata item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
//{
|
||||
// return CreateSingleImage(itemsWithImages, outputPathWithoutExtension, ImageType.Primary);
|
||||
//}
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace Emby.Server.Implementations.UserViews
|
|||
{
|
||||
}
|
||||
|
||||
public override IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public override IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ namespace Emby.Server.Implementations.UserViews
|
|||
};
|
||||
}
|
||||
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasImages item)
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasMetadata item)
|
||||
{
|
||||
var view = (CollectionFolder)item;
|
||||
|
||||
|
@ -94,12 +94,12 @@ namespace Emby.Server.Implementations.UserViews
|
|||
return GetFinalItems(items.Where(i => i.HasImage(ImageType.Primary) || i.HasImage(ImageType.Thumb)).ToList(), 8);
|
||||
}
|
||||
|
||||
protected override bool Supports(IHasImages item)
|
||||
protected override bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is CollectionFolder;
|
||||
}
|
||||
|
||||
protected override string CreateImage(IHasImages item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
protected override string CreateImage(IHasMetadata item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
{
|
||||
var outputPath = Path.ChangeExtension(outputPathWithoutExtension, ".png");
|
||||
|
||||
|
@ -126,7 +126,7 @@ namespace Emby.Server.Implementations.UserViews
|
|||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
public override IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public override IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ namespace Emby.Server.Implementations.UserViews
|
|||
};
|
||||
}
|
||||
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasImages item)
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasMetadata item)
|
||||
{
|
||||
var view = (ManualCollectionsFolder)item;
|
||||
|
||||
|
@ -152,12 +152,12 @@ namespace Emby.Server.Implementations.UserViews
|
|||
return GetFinalItems(items.Where(i => i.HasImage(ImageType.Primary) || i.HasImage(ImageType.Thumb)).ToList(), 8);
|
||||
}
|
||||
|
||||
protected override bool Supports(IHasImages item)
|
||||
protected override bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is ManualCollectionsFolder;
|
||||
}
|
||||
|
||||
protected override string CreateImage(IHasImages item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
protected override string CreateImage(IHasMetadata item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
{
|
||||
var outputPath = Path.ChangeExtension(outputPathWithoutExtension, ".png");
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Emby.Server.Implementations.UserViews
|
|||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
public override IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public override IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
var view = (UserView)item;
|
||||
if (IsUsingCollectionStrip(view))
|
||||
|
@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.UserViews
|
|||
};
|
||||
}
|
||||
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasImages item)
|
||||
protected override List<BaseItem> GetItemsWithImages(IHasMetadata item)
|
||||
{
|
||||
var view = (UserView)item;
|
||||
|
||||
|
@ -139,7 +139,7 @@ namespace Emby.Server.Implementations.UserViews
|
|||
return GetFinalItems(items.Where(i => i.HasImage(ImageType.Primary)).ToList());
|
||||
}
|
||||
|
||||
protected override bool Supports(IHasImages item)
|
||||
protected override bool Supports(IHasMetadata item)
|
||||
{
|
||||
var view = item as UserView;
|
||||
if (view != null)
|
||||
|
@ -163,7 +163,7 @@ namespace Emby.Server.Implementations.UserViews
|
|||
return collectionStripViewTypes.Contains(view.ViewType ?? string.Empty);
|
||||
}
|
||||
|
||||
protected override string CreateImage(IHasImages item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
protected override string CreateImage(IHasMetadata item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex)
|
||||
{
|
||||
if (itemsWithImages.Count == 0)
|
||||
{
|
||||
|
|
|
@ -312,7 +312,7 @@ namespace MediaBrowser.Api.Images
|
|||
return list;
|
||||
}
|
||||
|
||||
private ImageInfo GetImageInfo(IHasImages item, ItemImageInfo info, int? imageIndex)
|
||||
private ImageInfo GetImageInfo(IHasMetadata item, ItemImageInfo info, int? imageIndex)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -507,7 +507,7 @@ namespace MediaBrowser.Api.Images
|
|||
/// <param name="currentIndex">Index of the current.</param>
|
||||
/// <param name="newIndex">The new index.</param>
|
||||
/// <returns>Task.</returns>
|
||||
private Task UpdateItemIndex(IHasImages item, ImageType type, int currentIndex, int newIndex)
|
||||
private Task UpdateItemIndex(IHasMetadata item, ImageType type, int currentIndex, int newIndex)
|
||||
{
|
||||
return item.SwapImages(type, currentIndex, newIndex);
|
||||
}
|
||||
|
@ -520,7 +520,7 @@ namespace MediaBrowser.Api.Images
|
|||
/// <param name="isHeadRequest">if set to <c>true</c> [is head request].</param>
|
||||
/// <returns>System.Object.</returns>
|
||||
/// <exception cref="ResourceNotFoundException"></exception>
|
||||
public Task<object> GetImage(ImageRequest request, IHasImages item, bool isHeadRequest)
|
||||
public Task<object> GetImage(ImageRequest request, IHasMetadata item, bool isHeadRequest)
|
||||
{
|
||||
if (request.PercentPlayed.HasValue)
|
||||
{
|
||||
|
@ -603,7 +603,7 @@ namespace MediaBrowser.Api.Images
|
|||
isHeadRequest);
|
||||
}
|
||||
|
||||
private async Task<object> GetImageResult(IHasImages item,
|
||||
private async Task<object> GetImageResult(IHasMetadata item,
|
||||
ImageRequest request,
|
||||
ItemImageInfo image,
|
||||
bool cropwhitespace,
|
||||
|
@ -749,7 +749,7 @@ namespace MediaBrowser.Api.Images
|
|||
/// <param name="request">The request.</param>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
private ItemImageInfo GetImageInfo(ImageRequest request, IHasImages item)
|
||||
private ItemImageInfo GetImageInfo(ImageRequest request, IHasMetadata item)
|
||||
{
|
||||
var index = request.Index ?? 0;
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace MediaBrowser.Controller.Drawing
|
|||
/// <param name="item">The item.</param>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <returns>IEnumerable{IImageEnhancer}.</returns>
|
||||
IEnumerable<IImageEnhancer> GetSupportedEnhancers(IHasImages item, ImageType imageType);
|
||||
IEnumerable<IImageEnhancer> GetSupportedEnhancers(IHasMetadata item, ImageType imageType);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image cache tag.
|
||||
|
@ -62,7 +62,7 @@ namespace MediaBrowser.Controller.Drawing
|
|||
/// <param name="item">The item.</param>
|
||||
/// <param name="image">The image.</param>
|
||||
/// <returns>Guid.</returns>
|
||||
string GetImageCacheTag(IHasImages item, ItemImageInfo image);
|
||||
string GetImageCacheTag(IHasMetadata item, ItemImageInfo image);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image cache tag.
|
||||
|
@ -71,7 +71,7 @@ namespace MediaBrowser.Controller.Drawing
|
|||
/// <param name="image">The image.</param>
|
||||
/// <param name="imageEnhancers">The image enhancers.</param>
|
||||
/// <returns>Guid.</returns>
|
||||
string GetImageCacheTag(IHasImages item, ItemImageInfo image, List<IImageEnhancer> imageEnhancers);
|
||||
string GetImageCacheTag(IHasMetadata item, ItemImageInfo image, List<IImageEnhancer> imageEnhancers);
|
||||
|
||||
/// <summary>
|
||||
/// Processes the image.
|
||||
|
@ -95,7 +95,7 @@ namespace MediaBrowser.Controller.Drawing
|
|||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <returns>Task{System.String}.</returns>
|
||||
Task<string> GetEnhancedImage(IHasImages item, ImageType imageType, int imageIndex);
|
||||
Task<string> GetEnhancedImage(IHasMetadata item, ImageType imageType, int imageIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the supported image output formats.
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Controller.Drawing
|
|||
return new ImageSize(widthValue, height);
|
||||
}
|
||||
|
||||
private static double GetEstimatedAspectRatio(ImageType type, IHasImages item)
|
||||
private static double GetEstimatedAspectRatio(ImageType type, IHasMetadata item)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Drawing
|
|||
{
|
||||
public string ItemId { get; set; }
|
||||
public string ItemType { get; set; }
|
||||
public IHasImages Item { get; set; }
|
||||
public IHasMetadata Item { get; set; }
|
||||
|
||||
public ItemImageInfo Image { get; set; }
|
||||
|
||||
|
|
|
@ -5,12 +5,12 @@ namespace MediaBrowser.Controller.Drawing
|
|||
{
|
||||
public static class ImageProcessorExtensions
|
||||
{
|
||||
public static string GetImageCacheTag(this IImageProcessor processor, IHasImages item, ImageType imageType)
|
||||
public static string GetImageCacheTag(this IImageProcessor processor, IHasMetadata item, ImageType imageType)
|
||||
{
|
||||
return processor.GetImageCacheTag(item, imageType, 0);
|
||||
}
|
||||
|
||||
public static string GetImageCacheTag(this IImageProcessor processor, IHasImages item, ImageType imageType, int imageIndex)
|
||||
public static string GetImageCacheTag(this IImageProcessor processor, IHasMetadata item, ImageType imageType, int imageIndex)
|
||||
{
|
||||
var imageInfo = item.GetImageInfo(imageType, imageIndex);
|
||||
|
||||
|
|
|
@ -24,14 +24,14 @@ namespace MediaBrowser.Controller.Dto
|
|||
/// </summary>
|
||||
/// <param name="dto">The dto.</param>
|
||||
/// <param name="item">The item.</param>
|
||||
void AttachPrimaryImageAspectRatio(IItemDto dto, IHasImages item);
|
||||
void AttachPrimaryImageAspectRatio(IItemDto dto, IHasMetadata item);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the primary image aspect ratio.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <returns>System.Nullable<System.Double>.</returns>
|
||||
double? GetPrimaryImageAspectRatio(IHasImages item);
|
||||
double? GetPrimaryImageAspectRatio(IHasMetadata item);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base item dto.
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <summary>
|
||||
/// Class BaseItem
|
||||
/// </summary>
|
||||
public abstract class BaseItem : IHasProviderIds, IHasImages, IHasUserData, IHasMetadata, IHasLookupInfo<ItemLookupInfo>
|
||||
public abstract class BaseItem : IHasMetadata, IHasLookupInfo<ItemLookupInfo>
|
||||
{
|
||||
protected BaseItem()
|
||||
{
|
||||
|
|
|
@ -1,260 +0,0 @@
|
|||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.IO;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public interface IHasImages : IHasProviderIds, IHasUserData
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path.
|
||||
/// </summary>
|
||||
/// <value>The path.</value>
|
||||
string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the file name without extension.
|
||||
/// </summary>
|
||||
/// <value>The file name without extension.</value>
|
||||
string FileNameWithoutExtension { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the location.
|
||||
/// </summary>
|
||||
/// <value>The type of the location.</value>
|
||||
LocationType LocationType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the locked fields.
|
||||
/// </summary>
|
||||
/// <value>The locked fields.</value>
|
||||
List<MetadataFields> LockedFields { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the images.
|
||||
/// </summary>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <returns>IEnumerable{ItemImageInfo}.</returns>
|
||||
IEnumerable<ItemImageInfo> GetImages(ImageType imageType);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image path.
|
||||
/// </summary>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetImagePath(ImageType imageType, int imageIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image information.
|
||||
/// </summary>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <returns>ItemImageInfo.</returns>
|
||||
ItemImageInfo GetImageInfo(ImageType imageType, int imageIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the image.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="index">The index.</param>
|
||||
/// <param name="file">The file.</param>
|
||||
void SetImagePath(ImageType type, int index, FileSystemMetadata file);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified type has image.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <returns><c>true</c> if the specified type has image; otherwise, <c>false</c>.</returns>
|
||||
bool HasImage(ImageType type, int imageIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Allowses the multiple images.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||
bool AllowsMultipleImages(ImageType type);
|
||||
|
||||
/// <summary>
|
||||
/// Swaps the images.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="index1">The index1.</param>
|
||||
/// <param name="index2">The index2.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task SwapImages(ImageType type, int index1, int index2);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the primary image path.
|
||||
/// </summary>
|
||||
/// <value>The primary image path.</value>
|
||||
string PrimaryImagePath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the preferred metadata language.
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetPreferredMetadataLanguage();
|
||||
|
||||
/// <summary>
|
||||
/// Validates the images and returns true or false indicating if any were removed.
|
||||
/// </summary>
|
||||
bool ValidateImages(IDirectoryService directoryService);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is owned item.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value>
|
||||
bool IsOwnedItem { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the containing folder path.
|
||||
/// </summary>
|
||||
/// <value>The containing folder path.</value>
|
||||
string ContainingFolderPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Adds the images.
|
||||
/// </summary>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="images">The images.</param>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||
bool AddImages(ImageType imageType, List<FileSystemMetadata> images);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether [is save local metadata enabled].
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if [is save local metadata enabled]; otherwise, <c>false</c>.</returns>
|
||||
bool IsSaveLocalMetadataEnabled();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether [supports local metadata].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [supports local metadata]; otherwise, <c>false</c>.</value>
|
||||
bool SupportsLocalMetadata { get; }
|
||||
|
||||
bool IsInMixedFolder { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is locked.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is locked; otherwise, <c>false</c>.</value>
|
||||
bool IsLocked { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether [supports remote image downloading].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [supports remote image downloading]; otherwise, <c>false</c>.</value>
|
||||
bool SupportsRemoteImageDownloading { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal metadata path.
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetInternalMetadataPath();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether [always scan internal metadata path].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [always scan internal metadata path]; otherwise, <c>false</c>.</value>
|
||||
bool AlwaysScanInternalMetadataPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether [is internet metadata enabled].
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if [is internet metadata enabled]; otherwise, <c>false</c>.</returns>
|
||||
bool IsInternetMetadataEnabled();
|
||||
|
||||
/// <summary>
|
||||
/// Removes the image.
|
||||
/// </summary>
|
||||
/// <param name="image">The image.</param>
|
||||
void RemoveImage(ItemImageInfo image);
|
||||
|
||||
/// <summary>
|
||||
/// Updates to repository.
|
||||
/// </summary>
|
||||
/// <param name="updateReason">The update reason.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task UpdateToRepository(ItemUpdateType updateReason, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the image.
|
||||
/// </summary>
|
||||
/// <param name="image">The image.</param>
|
||||
/// <param name="index">The index.</param>
|
||||
void SetImage(ItemImageInfo image, int index);
|
||||
|
||||
double? GetDefaultPrimaryImageAspectRatio();
|
||||
|
||||
int? ProductionYear { get; set; }
|
||||
|
||||
List<string> Tags { get; set; }
|
||||
}
|
||||
|
||||
public static class HasImagesExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the image path.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
public static string GetImagePath(this IHasImages item, ImageType imageType)
|
||||
{
|
||||
return item.GetImagePath(imageType, 0);
|
||||
}
|
||||
|
||||
public static bool HasImage(this IHasImages item, ImageType imageType)
|
||||
{
|
||||
return item.HasImage(imageType, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the image path.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="file">The file.</param>
|
||||
public static void SetImagePath(this IHasImages item, ImageType imageType, FileSystemMetadata file)
|
||||
{
|
||||
item.SetImagePath(imageType, 0, file);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the image path.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="file">The file.</param>
|
||||
public static void SetImagePath(this IHasImages item, ImageType imageType, string file)
|
||||
{
|
||||
if (file.StartsWith("http", System.StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
item.SetImage(new ItemImageInfo
|
||||
{
|
||||
Path = file,
|
||||
Type = imageType
|
||||
}, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.SetImagePath(imageType, BaseItem.FileSystem.GetFileInfo(file));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.IO;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface IHasMetadata
|
||||
/// </summary>
|
||||
public interface IHasMetadata : IHasImages
|
||||
public interface IHasMetadata : IHasProviderIds, IHasUserData
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the preferred metadata country code.
|
||||
|
@ -65,5 +71,250 @@ namespace MediaBrowser.Controller.Entities
|
|||
int InheritedParentalRatingValue { get; set; }
|
||||
List<string> GetInheritedTags();
|
||||
long? RunTimeTicks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path.
|
||||
/// </summary>
|
||||
/// <value>The path.</value>
|
||||
string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the file name without extension.
|
||||
/// </summary>
|
||||
/// <value>The file name without extension.</value>
|
||||
string FileNameWithoutExtension { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the location.
|
||||
/// </summary>
|
||||
/// <value>The type of the location.</value>
|
||||
LocationType LocationType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the locked fields.
|
||||
/// </summary>
|
||||
/// <value>The locked fields.</value>
|
||||
List<MetadataFields> LockedFields { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the images.
|
||||
/// </summary>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <returns>IEnumerable{ItemImageInfo}.</returns>
|
||||
IEnumerable<ItemImageInfo> GetImages(ImageType imageType);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image path.
|
||||
/// </summary>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetImagePath(ImageType imageType, int imageIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image information.
|
||||
/// </summary>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <returns>ItemImageInfo.</returns>
|
||||
ItemImageInfo GetImageInfo(ImageType imageType, int imageIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the image.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="index">The index.</param>
|
||||
/// <param name="file">The file.</param>
|
||||
void SetImagePath(ImageType type, int index, FileSystemMetadata file);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified type has image.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <returns><c>true</c> if the specified type has image; otherwise, <c>false</c>.</returns>
|
||||
bool HasImage(ImageType type, int imageIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Allowses the multiple images.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||
bool AllowsMultipleImages(ImageType type);
|
||||
|
||||
/// <summary>
|
||||
/// Swaps the images.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="index1">The index1.</param>
|
||||
/// <param name="index2">The index2.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task SwapImages(ImageType type, int index1, int index2);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the primary image path.
|
||||
/// </summary>
|
||||
/// <value>The primary image path.</value>
|
||||
string PrimaryImagePath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the preferred metadata language.
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetPreferredMetadataLanguage();
|
||||
|
||||
/// <summary>
|
||||
/// Validates the images and returns true or false indicating if any were removed.
|
||||
/// </summary>
|
||||
bool ValidateImages(IDirectoryService directoryService);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is owned item.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value>
|
||||
bool IsOwnedItem { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the containing folder path.
|
||||
/// </summary>
|
||||
/// <value>The containing folder path.</value>
|
||||
string ContainingFolderPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Adds the images.
|
||||
/// </summary>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="images">The images.</param>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||
bool AddImages(ImageType imageType, List<FileSystemMetadata> images);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether [is save local metadata enabled].
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if [is save local metadata enabled]; otherwise, <c>false</c>.</returns>
|
||||
bool IsSaveLocalMetadataEnabled();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether [supports local metadata].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [supports local metadata]; otherwise, <c>false</c>.</value>
|
||||
bool SupportsLocalMetadata { get; }
|
||||
|
||||
bool IsInMixedFolder { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is locked.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is locked; otherwise, <c>false</c>.</value>
|
||||
bool IsLocked { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether [supports remote image downloading].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [supports remote image downloading]; otherwise, <c>false</c>.</value>
|
||||
bool SupportsRemoteImageDownloading { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal metadata path.
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetInternalMetadataPath();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether [always scan internal metadata path].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [always scan internal metadata path]; otherwise, <c>false</c>.</value>
|
||||
bool AlwaysScanInternalMetadataPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether [is internet metadata enabled].
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if [is internet metadata enabled]; otherwise, <c>false</c>.</returns>
|
||||
bool IsInternetMetadataEnabled();
|
||||
|
||||
/// <summary>
|
||||
/// Removes the image.
|
||||
/// </summary>
|
||||
/// <param name="image">The image.</param>
|
||||
void RemoveImage(ItemImageInfo image);
|
||||
|
||||
/// <summary>
|
||||
/// Updates to repository.
|
||||
/// </summary>
|
||||
/// <param name="updateReason">The update reason.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task UpdateToRepository(ItemUpdateType updateReason, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the image.
|
||||
/// </summary>
|
||||
/// <param name="image">The image.</param>
|
||||
/// <param name="index">The index.</param>
|
||||
void SetImage(ItemImageInfo image, int index);
|
||||
|
||||
double? GetDefaultPrimaryImageAspectRatio();
|
||||
|
||||
int? ProductionYear { get; set; }
|
||||
|
||||
List<string> Tags { get; set; }
|
||||
}
|
||||
|
||||
public static class HasMetadataExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the image path.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
public static string GetImagePath(this IHasMetadata item, ImageType imageType)
|
||||
{
|
||||
return item.GetImagePath(imageType, 0);
|
||||
}
|
||||
|
||||
public static bool HasImage(this IHasMetadata item, ImageType imageType)
|
||||
{
|
||||
return item.HasImage(imageType, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the image path.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="file">The file.</param>
|
||||
public static void SetImagePath(this IHasMetadata item, ImageType imageType, FileSystemMetadata file)
|
||||
{
|
||||
item.SetImagePath(imageType, 0, file);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the image path.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="file">The file.</param>
|
||||
public static void SetImagePath(this IHasMetadata item, ImageType imageType, string file)
|
||||
{
|
||||
if (file.StartsWith("http", System.StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
item.SetImage(new ItemImageInfo
|
||||
{
|
||||
Path = file,
|
||||
Type = imageType
|
||||
}, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.SetImagePath(imageType, BaseItem.FileSystem.GetFileInfo(file));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -520,7 +520,7 @@ namespace MediaBrowser.Controller.Library
|
|||
/// <param name="image">The image.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task<ItemImageInfo> ConvertImageToLocal(IHasImages item, ItemImageInfo image, int imageIndex);
|
||||
Task<ItemImageInfo> ConvertImageToLocal(IHasMetadata item, ItemImageInfo image, int imageIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the items.
|
||||
|
|
|
@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
public interface ILiveTvRecording : IHasImages, IHasMediaSources, IHasUserData, IHasStartDate, IHasProgramAttributes
|
||||
public interface ILiveTvRecording : IHasMetadata, IHasMediaSources, IHasUserData, IHasStartDate, IHasProgramAttributes
|
||||
{
|
||||
string ServiceName { get; set; }
|
||||
string ExternalId { get; set; }
|
||||
|
|
|
@ -99,7 +99,6 @@
|
|||
<Compile Include="Entities\GameSystem.cs" />
|
||||
<Compile Include="Entities\IHasAspectRatio.cs" />
|
||||
<Compile Include="Entities\IHasDisplayOrder.cs" />
|
||||
<Compile Include="Entities\IHasImages.cs" />
|
||||
<Compile Include="Entities\IHasMediaSources.cs" />
|
||||
<Compile Include="Entities\IHasProgramAttributes.cs" />
|
||||
<Compile Include="Entities\IHasScreenshots.cs" />
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <returns>IEnumerable{ImageType}.</returns>
|
||||
IEnumerable<ImageType> GetSupportedImages(IHasImages item);
|
||||
IEnumerable<ImageType> GetSupportedImages(IHasMetadata item);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image.
|
||||
|
@ -22,6 +22,6 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <param name="type">The type.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{DynamicImageResponse}.</returns>
|
||||
Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken);
|
||||
Task<DynamicImageResponse> GetImage(IHasMetadata item, ImageType type, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
|
@ -13,7 +13,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <param name="item">The item.</param>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <returns><c>true</c> if this enhancer will enhance the supplied image for the supplied item, <c>false</c> otherwise</returns>
|
||||
bool Supports(IHasImages item, ImageType imageType);
|
||||
bool Supports(IHasMetadata item, ImageType imageType);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the priority or order in which this enhancer should be run.
|
||||
|
@ -27,7 +27,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <param name="item">The item.</param>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <returns>Cache key relating to the current state of this item and configuration</returns>
|
||||
string GetConfigurationCacheKey(IHasImages item, ImageType imageType);
|
||||
string GetConfigurationCacheKey(IHasMetadata item, ImageType imageType);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the enhanced image.
|
||||
|
@ -37,7 +37,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <param name="originalImageSize">Size of the original image.</param>
|
||||
/// <returns>ImageSize.</returns>
|
||||
ImageSize GetEnhancedImageSize(IHasImages item, ImageType imageType, int imageIndex, ImageSize originalImageSize);
|
||||
ImageSize GetEnhancedImageSize(IHasMetadata item, ImageType imageType, int imageIndex, ImageSize originalImageSize);
|
||||
|
||||
/// <summary>
|
||||
/// Enhances the image async.
|
||||
|
@ -49,6 +49,6 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <returns>Task{Image}.</returns>
|
||||
/// <exception cref="System.ArgumentNullException"></exception>
|
||||
Task EnhanceImageAsync(IHasImages item, string inputFile, string outputFile, ImageType imageType, int imageIndex);
|
||||
Task EnhanceImageAsync(IHasMetadata item, string inputFile, string outputFile, ImageType imageType, int imageIndex);
|
||||
}
|
||||
}
|
|
@ -18,6 +18,6 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
||||
bool Supports(IHasImages item);
|
||||
bool Supports(IHasMetadata item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,6 @@ namespace MediaBrowser.Controller.Providers
|
|||
{
|
||||
public interface ILocalImageFileProvider : ILocalImageProvider
|
||||
{
|
||||
List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService);
|
||||
List<LocalImageInfo> GetImages(IHasMetadata item, IDirectoryService directoryService);
|
||||
}
|
||||
}
|
|
@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task SaveImage(IHasImages item, string url, ImageType type, int? imageIndex, CancellationToken cancellationToken);
|
||||
Task SaveImage(IHasMetadata item, string url, ImageType type, int? imageIndex, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Saves the image.
|
||||
|
@ -62,13 +62,13 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken);
|
||||
Task SaveImage(IHasMetadata item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Saves the image.
|
||||
/// </summary>
|
||||
/// <returns>Task.</returns>
|
||||
Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken);
|
||||
Task SaveImage(IHasMetadata item, string source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the metadata providers.
|
||||
|
@ -84,14 +84,14 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <param name="query">The query.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{IEnumerable{RemoteImageInfo}}.</returns>
|
||||
Task<IEnumerable<RemoteImageInfo>> GetAvailableRemoteImages(IHasImages item, RemoteImageQuery query, CancellationToken cancellationToken);
|
||||
Task<IEnumerable<RemoteImageInfo>> GetAvailableRemoteImages(IHasMetadata item, RemoteImageQuery query, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image providers.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <returns>IEnumerable{ImageProviderInfo}.</returns>
|
||||
IEnumerable<ImageProviderInfo> GetRemoteImageProviderInfo(IHasImages item);
|
||||
IEnumerable<ImageProviderInfo> GetRemoteImageProviderInfo(IHasMetadata item);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all metadata plugins.
|
||||
|
@ -135,7 +135,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <returns>MetadataOptions.</returns>
|
||||
MetadataOptions GetMetadataOptions(IHasImages item);
|
||||
MetadataOptions GetMetadataOptions(IHasMetadata item);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the remote search results.
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <returns>IEnumerable{ImageType}.</returns>
|
||||
IEnumerable<ImageType> GetSupportedImages(IHasImages item);
|
||||
IEnumerable<ImageType> GetSupportedImages(IHasMetadata item);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the images.
|
||||
|
@ -26,7 +26,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <param name="item">The item.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{IEnumerable{RemoteImageInfo}}.</returns>
|
||||
Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken);
|
||||
Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image response.
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
get { return "Collection Folder Images"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is CollectionFolder && item.SupportsLocalMetadata;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
}
|
||||
}
|
||||
|
||||
public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
|
||||
public List<LocalImageInfo> GetImages(IHasMetadata item, IDirectoryService directoryService)
|
||||
{
|
||||
var collectionFolder = (CollectionFolder)item;
|
||||
|
||||
|
|
|
@ -31,12 +31,12 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
get { return 0; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Episode && item.SupportsLocalMetadata;
|
||||
}
|
||||
|
||||
public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
|
||||
public List<LocalImageInfo> GetImages(IHasMetadata item, IDirectoryService directoryService)
|
||||
{
|
||||
var parentPath = _fileSystem.GetDirectoryName(item.Path);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
get { return "Images By Name"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is CollectionFolder;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
}
|
||||
}
|
||||
|
||||
public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
|
||||
public List<LocalImageInfo> GetImages(IHasMetadata item, IDirectoryService directoryService)
|
||||
{
|
||||
var name = _fileSystem.GetValidFilename(item.Name);
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
get { return "Internal Images"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
if (item is Photo)
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
}
|
||||
}
|
||||
|
||||
public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
|
||||
public List<LocalImageInfo> GetImages(IHasMetadata item, IDirectoryService directoryService)
|
||||
{
|
||||
var path = item.GetInternalMetadataPath();
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
get { return 0; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
if (item.SupportsLocalMetadata)
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
return false;
|
||||
}
|
||||
|
||||
private IEnumerable<FileSystemMetadata> GetFiles(IHasImages item, bool includeDirectories, IDirectoryService directoryService)
|
||||
private IEnumerable<FileSystemMetadata> GetFiles(IHasMetadata item, bool includeDirectories, IDirectoryService directoryService)
|
||||
{
|
||||
if (item.LocationType != LocationType.FileSystem)
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
.OrderBy(i => BaseItem.SupportedImageExtensionsList.IndexOf(i.Extension ?? string.Empty));
|
||||
}
|
||||
|
||||
public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
|
||||
public List<LocalImageInfo> GetImages(IHasMetadata item, IDirectoryService directoryService)
|
||||
{
|
||||
var files = GetFiles(item, true, directoryService).ToList();
|
||||
|
||||
|
@ -96,12 +96,12 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
return list;
|
||||
}
|
||||
|
||||
public List<LocalImageInfo> GetImages(IHasImages item, string path, bool isPathInMediaFolder, IDirectoryService directoryService)
|
||||
public List<LocalImageInfo> GetImages(IHasMetadata item, string path, bool isPathInMediaFolder, IDirectoryService directoryService)
|
||||
{
|
||||
return GetImages(item, new[] { path }, isPathInMediaFolder, directoryService);
|
||||
}
|
||||
|
||||
public List<LocalImageInfo> GetImages(IHasImages item, IEnumerable<string> paths, bool arePathsInMediaFolders, IDirectoryService directoryService)
|
||||
public List<LocalImageInfo> GetImages(IHasMetadata item, IEnumerable<string> paths, bool arePathsInMediaFolders, IDirectoryService directoryService)
|
||||
{
|
||||
IEnumerable<FileSystemMetadata> files;
|
||||
|
||||
|
@ -131,7 +131,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
return list;
|
||||
}
|
||||
|
||||
private void PopulateImages(IHasImages item, List<LocalImageInfo> images, List<FileSystemMetadata> files, bool supportParentSeriesFiles, IDirectoryService directoryService)
|
||||
private void PopulateImages(IHasMetadata item, List<LocalImageInfo> images, List<FileSystemMetadata> files, bool supportParentSeriesFiles, IDirectoryService directoryService)
|
||||
{
|
||||
if (supportParentSeriesFiles)
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
PopulateScreenshots(images, files, imagePrefix, isInMixedFolder);
|
||||
}
|
||||
|
||||
private void PopulatePrimaryImages(IHasImages item, List<LocalImageInfo> images, List<FileSystemMetadata> files, string imagePrefix, bool isInMixedFolder)
|
||||
private void PopulatePrimaryImages(IHasMetadata item, List<LocalImageInfo> images, List<FileSystemMetadata> files, string imagePrefix, bool isInMixedFolder)
|
||||
{
|
||||
var names = new List<string>
|
||||
{
|
||||
|
@ -231,7 +231,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
|||
}
|
||||
}
|
||||
|
||||
private void PopulateBackdrops(IHasImages item, List<LocalImageInfo> images, List<FileSystemMetadata> files, string imagePrefix, bool isInMixedFolder, IDirectoryService directoryService)
|
||||
private void PopulateBackdrops(IHasMetadata item, List<LocalImageInfo> images, List<FileSystemMetadata> files, string imagePrefix, bool isInMixedFolder, IDirectoryService directoryService)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.Path))
|
||||
{
|
||||
|
|
|
@ -33,12 +33,12 @@ namespace MediaBrowser.Providers.BoxSets
|
|||
get { return "TheMovieDb"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is BoxSet;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ namespace MediaBrowser.Providers.BoxSets
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var tmdbId = item.GetProviderId(MetadataProviders.Tmdb);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace MediaBrowser.Providers.ImagesByName
|
|||
return file;
|
||||
}
|
||||
|
||||
public static string FindMatch(IHasImages item, IEnumerable<string> images)
|
||||
public static string FindMatch(IHasMetadata item, IEnumerable<string> images)
|
||||
{
|
||||
var name = GetComparableName(item.Name);
|
||||
|
||||
|
|
|
@ -67,12 +67,12 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">mimeType</exception>
|
||||
public Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken)
|
||||
public Task SaveImage(IHasMetadata item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken)
|
||||
{
|
||||
return SaveImage(item, source, mimeType, type, imageIndex, null, cancellationToken);
|
||||
}
|
||||
|
||||
public async Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken)
|
||||
public async Task SaveImage(IHasMetadata item, Stream source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrEmpty(mimeType))
|
||||
{
|
||||
|
@ -274,7 +274,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <param name="mimeType">Type of the MIME.</param>
|
||||
/// <param name="saveLocally">if set to <c>true</c> [save locally].</param>
|
||||
/// <returns>IEnumerable{System.String}.</returns>
|
||||
private string[] GetSavePaths(IHasImages item, ImageType type, int? imageIndex, string mimeType, bool saveLocally)
|
||||
private string[] GetSavePaths(IHasMetadata item, ImageType type, int? imageIndex, string mimeType, bool saveLocally)
|
||||
{
|
||||
if (!saveLocally || (_config.Configuration.ImageSavingConvention == ImageSavingConvention.Legacy))
|
||||
{
|
||||
|
@ -296,7 +296,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// or
|
||||
/// imageIndex
|
||||
/// </exception>
|
||||
private ItemImageInfo GetCurrentImage(IHasImages item, ImageType type, int imageIndex)
|
||||
private ItemImageInfo GetCurrentImage(IHasMetadata item, ImageType type, int imageIndex)
|
||||
{
|
||||
return item.GetImageInfo(type, imageIndex);
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <exception cref="System.ArgumentNullException">imageIndex
|
||||
/// or
|
||||
/// imageIndex</exception>
|
||||
private void SetImagePath(IHasImages item, ImageType type, int? imageIndex, string path)
|
||||
private void SetImagePath(IHasMetadata item, ImageType type, int? imageIndex, string path)
|
||||
{
|
||||
item.SetImagePath(type, imageIndex ?? 0, _fileSystem.GetFileInfo(path));
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// or
|
||||
/// imageIndex
|
||||
/// </exception>
|
||||
private string GetStandardSavePath(IHasImages item, ImageType type, int? imageIndex, string mimeType, bool saveLocally)
|
||||
private string GetStandardSavePath(IHasMetadata item, ImageType type, int? imageIndex, string mimeType, bool saveLocally)
|
||||
{
|
||||
var season = item as Season;
|
||||
var extension = MimeTypes.ToExtension(mimeType);
|
||||
|
@ -483,7 +483,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <param name="mimeType">Type of the MIME.</param>
|
||||
/// <returns>IEnumerable{System.String}.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">imageIndex</exception>
|
||||
private string[] GetCompatibleSavePaths(IHasImages item, ImageType type, int? imageIndex, string mimeType)
|
||||
private string[] GetCompatibleSavePaths(IHasMetadata item, ImageType type, int? imageIndex, string mimeType)
|
||||
{
|
||||
var season = item as Season;
|
||||
|
||||
|
@ -603,7 +603,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <param name="imageFilename">The image filename.</param>
|
||||
/// <param name="extension">The extension.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
private string GetSavePathForItemInMixedFolder(IHasImages item, ImageType type, string imageFilename, string extension)
|
||||
private string GetSavePathForItemInMixedFolder(IHasMetadata item, ImageType type, string imageFilename, string extension)
|
||||
{
|
||||
if (type == ImageType.Primary)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public bool ValidateImages(IHasImages item, IEnumerable<IImageProvider> providers, IDirectoryService directoryService)
|
||||
public bool ValidateImages(IHasMetadata item, IEnumerable<IImageProvider> providers, IDirectoryService directoryService)
|
||||
{
|
||||
var hasChanges = false;
|
||||
|
||||
|
@ -60,7 +60,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
return hasChanges;
|
||||
}
|
||||
|
||||
public async Task<RefreshResult> RefreshImages(IHasImages item, LibraryOptions libraryOptions, IEnumerable<IImageProvider> imageProviders, ImageRefreshOptions refreshOptions, MetadataOptions savedOptions, CancellationToken cancellationToken)
|
||||
public async Task<RefreshResult> RefreshImages(IHasMetadata item, LibraryOptions libraryOptions, IEnumerable<IImageProvider> imageProviders, ImageRefreshOptions refreshOptions, MetadataOptions savedOptions, CancellationToken cancellationToken)
|
||||
{
|
||||
if (refreshOptions.IsReplacingImage(ImageType.Backdrop))
|
||||
{
|
||||
|
@ -118,7 +118,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <param name="result">The result.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
private async Task RefreshFromProvider(IHasImages item,
|
||||
private async Task RefreshFromProvider(IHasMetadata item,
|
||||
IDynamicImageProvider provider,
|
||||
ImageRefreshOptions refreshOptions,
|
||||
MetadataOptions savedOptions,
|
||||
|
@ -203,7 +203,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
ImageType.Thumb
|
||||
};
|
||||
|
||||
private bool HasImage(IHasImages item, ImageType type)
|
||||
private bool HasImage(IHasMetadata item, ImageType type)
|
||||
{
|
||||
var image = item.GetImageInfo(type, 0);
|
||||
|
||||
|
@ -220,7 +220,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <param name="backdropLimit">The backdrop limit.</param>
|
||||
/// <param name="screenshotLimit">The screenshot limit.</param>
|
||||
/// <returns><c>true</c> if the specified item contains images; otherwise, <c>false</c>.</returns>
|
||||
private bool ContainsImages(IHasImages item, List<ImageType> images, MetadataOptions savedOptions, int backdropLimit, int screenshotLimit)
|
||||
private bool ContainsImages(IHasMetadata item, List<ImageType> images, MetadataOptions savedOptions, int backdropLimit, int screenshotLimit)
|
||||
{
|
||||
if (_singularImages.Any(i => images.Contains(i) && !HasImage(item, i) && savedOptions.GetLimit(i) > 0))
|
||||
{
|
||||
|
@ -253,7 +253,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <param name="result">The result.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
private async Task RefreshFromProvider(IHasImages item, LibraryOptions libraryOptions,
|
||||
private async Task RefreshFromProvider(IHasMetadata item, LibraryOptions libraryOptions,
|
||||
IRemoteImageProvider provider,
|
||||
ImageRefreshOptions refreshOptions,
|
||||
MetadataOptions savedOptions,
|
||||
|
@ -333,7 +333,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
}
|
||||
}
|
||||
|
||||
private bool IsEnabled(MetadataOptions options, ImageType type, IHasImages item)
|
||||
private bool IsEnabled(MetadataOptions options, ImageType type, IHasMetadata item)
|
||||
{
|
||||
if (type == ImageType.Backdrop)
|
||||
{
|
||||
|
@ -360,7 +360,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
return options.IsEnabled(type);
|
||||
}
|
||||
|
||||
private void ClearImages(IHasImages item, ImageType type)
|
||||
private void ClearImages(IHasMetadata item, ImageType type)
|
||||
{
|
||||
var deleted = false;
|
||||
var deletedImages = new List<ItemImageInfo>();
|
||||
|
@ -395,7 +395,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
}
|
||||
}
|
||||
|
||||
public bool MergeImages(IHasImages item, List<LocalImageInfo> images)
|
||||
public bool MergeImages(IHasMetadata item, List<LocalImageInfo> images)
|
||||
{
|
||||
var changed = false;
|
||||
|
||||
|
@ -453,7 +453,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
return changed;
|
||||
}
|
||||
|
||||
private bool UpdateMultiImages(IHasImages item, List<LocalImageInfo> images, ImageType type)
|
||||
private bool UpdateMultiImages(IHasMetadata item, List<LocalImageInfo> images, ImageType type)
|
||||
{
|
||||
var changed = false;
|
||||
|
||||
|
@ -471,7 +471,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
return changed;
|
||||
}
|
||||
|
||||
private async Task<bool> DownloadImage(IHasImages item, LibraryOptions libraryOptions,
|
||||
private async Task<bool> DownloadImage(IHasMetadata item, LibraryOptions libraryOptions,
|
||||
IRemoteImageProvider provider,
|
||||
RefreshResult result,
|
||||
IEnumerable<RemoteImageInfo> images,
|
||||
|
@ -517,7 +517,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
return false;
|
||||
}
|
||||
|
||||
private bool EnableImageStub(IHasImages item, ImageType type, LibraryOptions libraryOptions)
|
||||
private bool EnableImageStub(IHasMetadata item, ImageType type, LibraryOptions libraryOptions)
|
||||
{
|
||||
if (item is LiveTvProgram)
|
||||
{
|
||||
|
@ -557,14 +557,14 @@ namespace MediaBrowser.Providers.Manager
|
|||
}
|
||||
}
|
||||
|
||||
private void SaveImageStub(IHasImages item, ImageType imageType, IEnumerable<string> urls)
|
||||
private void SaveImageStub(IHasMetadata item, ImageType imageType, IEnumerable<string> urls)
|
||||
{
|
||||
var newIndex = item.AllowsMultipleImages(imageType) ? item.GetImages(imageType).Count() : 0;
|
||||
|
||||
SaveImageStub(item, imageType, urls, newIndex);
|
||||
}
|
||||
|
||||
private void SaveImageStub(IHasImages item, ImageType imageType, IEnumerable<string> urls, int newIndex)
|
||||
private void SaveImageStub(IHasMetadata item, ImageType imageType, IEnumerable<string> urls, int newIndex)
|
||||
{
|
||||
var path = string.Join("|", urls.Take(1).ToArray());
|
||||
|
||||
|
@ -576,7 +576,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
}, newIndex);
|
||||
}
|
||||
|
||||
private async Task DownloadBackdrops(IHasImages item, LibraryOptions libraryOptions, ImageType imageType, int limit, IRemoteImageProvider provider, RefreshResult result, IEnumerable<RemoteImageInfo> images, int minWidth, CancellationToken cancellationToken)
|
||||
private async Task DownloadBackdrops(IHasMetadata item, LibraryOptions libraryOptions, ImageType imageType, int limit, IRemoteImageProvider provider, RefreshResult result, IEnumerable<RemoteImageInfo> images, int minWidth, CancellationToken cancellationToken)
|
||||
{
|
||||
foreach (var image in images.Where(i => i.Type == imageType))
|
||||
{
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
return Task.FromResult(ItemUpdateType.None);
|
||||
}
|
||||
|
||||
public async Task SaveImage(IHasImages item, string url, ImageType type, int? imageIndex, CancellationToken cancellationToken)
|
||||
public async Task SaveImage(IHasMetadata item, string url, ImageType type, int? imageIndex, CancellationToken cancellationToken)
|
||||
{
|
||||
var response = await _httpClient.GetResponse(new HttpRequestOptions
|
||||
{
|
||||
|
@ -142,12 +142,12 @@ namespace MediaBrowser.Providers.Manager
|
|||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken)
|
||||
public Task SaveImage(IHasMetadata item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken)
|
||||
{
|
||||
return new ImageSaver(ConfigurationManager, _libraryMonitor, _fileSystem, _logger, _memoryStreamProvider).SaveImage(item, source, mimeType, type, imageIndex, cancellationToken);
|
||||
}
|
||||
|
||||
public Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken)
|
||||
public Task SaveImage(IHasMetadata item, string source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(source))
|
||||
{
|
||||
|
@ -159,7 +159,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
return new ImageSaver(ConfigurationManager, _libraryMonitor, _fileSystem, _logger, _memoryStreamProvider).SaveImage(item, fileStream, mimeType, type, imageIndex, saveLocallyWithMedia, cancellationToken);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetAvailableRemoteImages(IHasImages item, RemoteImageQuery query, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetAvailableRemoteImages(IHasMetadata item, RemoteImageQuery query, CancellationToken cancellationToken)
|
||||
{
|
||||
var providers = GetRemoteImageProviders(item, query.IncludeDisabledProviders);
|
||||
|
||||
|
@ -196,7 +196,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <param name="preferredLanguages">The preferred languages.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <returns>Task{IEnumerable{RemoteImageInfo}}.</returns>
|
||||
private async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken, IRemoteImageProvider provider, List<string> preferredLanguages, ImageType? type = null)
|
||||
private async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken, IRemoteImageProvider provider, List<string> preferredLanguages, ImageType? type = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -232,7 +232,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <returns>IEnumerable{IImageProvider}.</returns>
|
||||
public IEnumerable<ImageProviderInfo> GetRemoteImageProviderInfo(IHasImages item)
|
||||
public IEnumerable<ImageProviderInfo> GetRemoteImageProviderInfo(IHasMetadata item)
|
||||
{
|
||||
return GetRemoteImageProviders(item, true).Select(i => new ImageProviderInfo
|
||||
{
|
||||
|
@ -241,12 +241,12 @@ namespace MediaBrowser.Providers.Manager
|
|||
});
|
||||
}
|
||||
|
||||
public IEnumerable<IImageProvider> GetImageProviders(IHasImages item, ImageRefreshOptions refreshOptions)
|
||||
public IEnumerable<IImageProvider> GetImageProviders(IHasMetadata item, ImageRefreshOptions refreshOptions)
|
||||
{
|
||||
return GetImageProviders(item, GetMetadataOptions(item), refreshOptions, false);
|
||||
}
|
||||
|
||||
private IEnumerable<IImageProvider> GetImageProviders(IHasImages item, MetadataOptions options, ImageRefreshOptions refreshOptions, bool includeDisabled)
|
||||
private IEnumerable<IImageProvider> GetImageProviders(IHasMetadata item, MetadataOptions options, ImageRefreshOptions refreshOptions, bool includeDisabled)
|
||||
{
|
||||
// Avoid implicitly captured closure
|
||||
var currentOptions = options;
|
||||
|
@ -291,7 +291,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
.ThenBy(GetDefaultOrder);
|
||||
}
|
||||
|
||||
private IEnumerable<IRemoteImageProvider> GetRemoteImageProviders(IHasImages item, bool includeDisabled)
|
||||
private IEnumerable<IRemoteImageProvider> GetRemoteImageProviders(IHasMetadata item, bool includeDisabled)
|
||||
{
|
||||
var options = GetMetadataOptions(item);
|
||||
|
||||
|
@ -339,7 +339,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
return true;
|
||||
}
|
||||
|
||||
private bool CanRefresh(IImageProvider provider, IHasImages item, MetadataOptions options, ImageRefreshOptions refreshOptions, bool includeDisabled)
|
||||
private bool CanRefresh(IImageProvider provider, IHasMetadata item, MetadataOptions options, ImageRefreshOptions refreshOptions, bool includeDisabled)
|
||||
{
|
||||
if (!includeDisabled)
|
||||
{
|
||||
|
@ -530,7 +530,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
}
|
||||
|
||||
private void AddImagePlugins<T>(List<MetadataPlugin> list, T item, List<IImageProvider> imageProviders)
|
||||
where T : IHasImages
|
||||
where T : IHasMetadata
|
||||
{
|
||||
|
||||
// Locals
|
||||
|
@ -550,7 +550,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
}));
|
||||
}
|
||||
|
||||
public MetadataOptions GetMetadataOptions(IHasImages item)
|
||||
public MetadataOptions GetMetadataOptions(IHasMetadata item)
|
||||
{
|
||||
var type = item.GetType().Name;
|
||||
|
||||
|
|
|
@ -31,12 +31,12 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType> { ImageType.Primary };
|
||||
}
|
||||
|
||||
public Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken)
|
||||
public Task<DynamicImageResponse> GetImage(IHasMetadata item, ImageType type, CancellationToken cancellationToken)
|
||||
{
|
||||
var audio = (Audio)item;
|
||||
|
||||
|
@ -127,7 +127,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
get { return "Image Extractor"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
var audio = item as Audio;
|
||||
|
||||
|
|
|
@ -29,12 +29,12 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType> { ImageType.Primary };
|
||||
}
|
||||
|
||||
public Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken)
|
||||
public Task<DynamicImageResponse> GetImage(IHasMetadata item, ImageType type, CancellationToken cancellationToken)
|
||||
{
|
||||
var video = (Video)item;
|
||||
|
||||
|
@ -129,7 +129,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
get { return "Screen Grabber"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
var video = item as Video;
|
||||
|
||||
|
|
|
@ -60,12 +60,12 @@ namespace MediaBrowser.Providers.Movies
|
|||
get { return "FanArt"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Movie || item is BoxSet || item is MusicVideo;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -79,7 +79,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var baseItem = (BaseItem)item;
|
||||
var list = new List<RemoteImageInfo>();
|
||||
|
|
|
@ -41,12 +41,12 @@ namespace MediaBrowser.Providers.Movies
|
|||
get { return "TheMovieDb"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Movie || item is MusicVideo || item is Trailer;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var list = new List<RemoteImageInfo>();
|
||||
|
||||
|
|
|
@ -11,12 +11,12 @@ namespace MediaBrowser.Providers.Music
|
|||
{
|
||||
public class AlbumImageFromSongProvider : IDynamicImageProvider
|
||||
{
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType> { ImageType.Primary };
|
||||
}
|
||||
|
||||
public Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken)
|
||||
public Task<DynamicImageResponse> GetImage(IHasMetadata item, ImageType type, CancellationToken cancellationToken)
|
||||
{
|
||||
var album = (MusicAlbum)item;
|
||||
|
||||
|
@ -38,7 +38,7 @@ namespace MediaBrowser.Providers.Music
|
|||
get { return "Image Extractor"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is MusicAlbum;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace MediaBrowser.Providers.Music
|
|||
_json = json;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ namespace MediaBrowser.Providers.Music
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var id = item.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup);
|
||||
|
||||
|
@ -105,7 +105,7 @@ namespace MediaBrowser.Providers.Music
|
|||
}
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is MusicAlbum;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace MediaBrowser.Providers.Music
|
|||
_httpClient = httpClient;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ namespace MediaBrowser.Providers.Music
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var id = item.GetProviderId(MetadataProviders.MusicBrainzArtist);
|
||||
|
||||
|
@ -138,7 +138,7 @@ namespace MediaBrowser.Providers.Music
|
|||
get { return "TheAudioDB"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is MusicArtist;
|
||||
}
|
||||
|
|
|
@ -47,12 +47,12 @@ namespace MediaBrowser.Providers.Music
|
|||
get { return "FanArt"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is MusicAlbum;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ namespace MediaBrowser.Providers.Music
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var album = (MusicAlbum)item;
|
||||
|
||||
|
|
|
@ -58,12 +58,12 @@ namespace MediaBrowser.Providers.Music
|
|||
get { return "FanArt"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is MusicArtist;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ namespace MediaBrowser.Providers.Music
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var artist = (MusicArtist)item;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace MediaBrowser.Providers.Omdb
|
|||
_configurationManager = configurationManager;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ namespace MediaBrowser.Providers.Omdb
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var imdbId = item.GetProviderId(MetadataProviders.Imdb);
|
||||
|
||||
|
@ -91,7 +91,7 @@ namespace MediaBrowser.Providers.Omdb
|
|||
get { return "The Open Movie Database"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Movie || item is Trailer || item is Episode;
|
||||
}
|
||||
|
|
|
@ -37,12 +37,12 @@ namespace MediaBrowser.Providers.People
|
|||
get { return "TheMovieDb"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Person;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ namespace MediaBrowser.Providers.People
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var person = (Person)item;
|
||||
var id = person.GetProviderId(MetadataProviders.Tmdb);
|
||||
|
|
|
@ -48,12 +48,12 @@ namespace MediaBrowser.Providers.People
|
|||
get { return "TheTVDB"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Person;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ namespace MediaBrowser.Providers.People
|
|||
};
|
||||
}
|
||||
|
||||
public Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var seriesWithPerson = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
|
|
|
@ -37,12 +37,12 @@ namespace MediaBrowser.Providers.Studios
|
|||
get { return "Emby Designs"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Studio;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -51,12 +51,12 @@ namespace MediaBrowser.Providers.Studios
|
|||
};
|
||||
}
|
||||
|
||||
public Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
return GetImages(item, true, true, cancellationToken);
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, bool posters, bool thumbs, CancellationToken cancellationToken)
|
||||
private async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, bool posters, bool thumbs, CancellationToken cancellationToken)
|
||||
{
|
||||
var list = new List<RemoteImageInfo>();
|
||||
|
||||
|
@ -83,7 +83,7 @@ namespace MediaBrowser.Providers.Studios
|
|||
return list.Where(i => i != null);
|
||||
}
|
||||
|
||||
private RemoteImageInfo GetImage(IHasImages item, string filename, ImageType type, string remoteFilename)
|
||||
private RemoteImageInfo GetImage(IHasMetadata item, string filename, ImageType type, string remoteFilename)
|
||||
{
|
||||
var list = ImageUtils.GetAvailableImages(filename, _fileSystem);
|
||||
|
||||
|
|
|
@ -50,12 +50,12 @@ namespace MediaBrowser.Providers.TV
|
|||
get { return "FanArt"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Season;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ namespace MediaBrowser.Providers.TV
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var list = new List<RemoteImageInfo>();
|
||||
|
||||
|
|
|
@ -59,12 +59,12 @@ namespace MediaBrowser.Providers.TV
|
|||
get { return "FanArt"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Series;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -77,7 +77,7 @@ namespace MediaBrowser.Providers.TV
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var list = new List<RemoteImageInfo>();
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace MediaBrowser.Providers.TV
|
|||
: base(httpClient, configurationManager, jsonSerializer, fileSystem, localization, logManager)
|
||||
{}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ namespace MediaBrowser.Providers.TV
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var episode = (Controller.Entities.TV.Episode)item;
|
||||
var series = episode.Series;
|
||||
|
@ -125,7 +125,7 @@ namespace MediaBrowser.Providers.TV
|
|||
get { return "TheMovieDb"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Controller.Entities.TV.Episode;
|
||||
}
|
||||
|
|
|
@ -40,12 +40,12 @@ namespace MediaBrowser.Providers.TV
|
|||
get { return "TheMovieDb"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Series;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ namespace MediaBrowser.Providers.TV
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var list = new List<RemoteImageInfo>();
|
||||
|
||||
|
|
|
@ -35,12 +35,12 @@ namespace MediaBrowser.Providers.TV
|
|||
get { return "TheTVDB"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Episode;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Providers.TV
|
|||
};
|
||||
}
|
||||
|
||||
public Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var episode = (Episode)item;
|
||||
var series = episode.Series;
|
||||
|
|
|
@ -48,12 +48,12 @@ namespace MediaBrowser.Providers.TV
|
|||
get { return "TheTVDB"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Season;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ namespace MediaBrowser.Providers.TV
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
var season = (Season)item;
|
||||
var series = season.Series;
|
||||
|
|
|
@ -49,12 +49,12 @@ namespace MediaBrowser.Providers.TV
|
|||
get { return "TheTVDB"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
public bool Supports(IHasMetadata item)
|
||||
{
|
||||
return item is Series;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasMetadata item)
|
||||
{
|
||||
return new List<ImageType>
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ namespace MediaBrowser.Providers.TV
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetImages(IHasMetadata item, CancellationToken cancellationToken)
|
||||
{
|
||||
if (TvdbSeriesProvider.IsValidSeries(item.ProviderIds))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user