mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
consolidate interfaces
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user