diff options
Diffstat (limited to 'MediaBrowser.Controller/Entities/IHasImages.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/IHasImages.cs | 76 |
1 files changed, 59 insertions, 17 deletions
diff --git a/MediaBrowser.Controller/Entities/IHasImages.cs b/MediaBrowser.Controller/Entities/IHasImages.cs index dd6194bc7..d53eba11a 100644 --- a/MediaBrowser.Controller/Entities/IHasImages.cs +++ b/MediaBrowser.Controller/Entities/IHasImages.cs @@ -1,6 +1,8 @@ -using MediaBrowser.Model.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; +using System.IO; using System.Threading.Tasks; namespace MediaBrowser.Controller.Entities @@ -32,6 +34,13 @@ namespace MediaBrowser.Controller.Entities LocationType LocationType { 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> @@ -40,19 +49,20 @@ namespace MediaBrowser.Controller.Entities string GetImagePath(ImageType imageType, int imageIndex); /// <summary> - /// Gets the image date modified. + /// Gets the image information. /// </summary> - /// <param name="imagePath">The image path.</param> - /// <returns>DateTime.</returns> - DateTime GetImageDateModified(string imagePath); + /// <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="path">The path.</param> - void SetImagePath(ImageType type, int index, string path); + /// <param name="file">The file.</param> + void SetImagePath(ImageType type, int index, FileInfo file); /// <summary> /// Determines whether the specified type has image. @@ -63,6 +73,13 @@ namespace MediaBrowser.Controller.Entities 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> @@ -92,13 +109,7 @@ namespace MediaBrowser.Controller.Entities /// <summary> /// Validates the images and returns true or false indicating if any were removed. /// </summary> - bool ValidateImages(); - - /// <summary> - /// Gets or sets the backdrop image paths. - /// </summary> - /// <value>The backdrop image paths.</value> - List<string> BackdropImagePaths { get; set; } + bool ValidateImages(IDirectoryService directoryService); /// <summary> /// Gets a value indicating whether this instance is owned item. @@ -111,6 +122,26 @@ namespace MediaBrowser.Controller.Entities /// </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, IEnumerable<FileInfo> 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; } } public static class HasImagesExtensions @@ -136,10 +167,21 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <param name="item">The item.</param> /// <param name="imageType">Type of the image.</param> - /// <param name="path">The path.</param> - public static void SetImagePath(this IHasImages item, ImageType imageType, string path) + /// <param name="file">The file.</param> + public static void SetImagePath(this IHasImages item, ImageType imageType, FileInfo 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) { - item.SetImagePath(imageType, 0, path); + item.SetImagePath(imageType, new FileInfo(file)); } } } |
