The Free Software Media System - Server Backend & API
added new image params
Luke Pulverentiad1a9a4932b1
diff --git a/MediaBrowser.Api/Images/ImageRequest.cs b/MediaBrowser.Api/Images/ImageRequest.csindex 3ea86e01cc..0b6f09c5a2 100644--- a/MediaBrowser.Api/Images/ImageRequest.cs+++ b/MediaBrowser.Api/Images/ImageRequest.cs@@ -46,8 +46,16 @@ namespace MediaBrowser.Api.Images[ApiMember(Name = "Tag", Description = "Optional. Supply the cache tag from the item object to receive strong caching headers.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]public string Tag { get; set; }- [ApiMember(Name = "CropWhitespace", Description = "Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]+ [ApiMember(Name = "CropWhitespace", Description = "Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]public bool? CropWhitespace { get; set; }++ [ApiMember(Name = "EnableImageEnhancers", Description = "Enable or disable image enhancers such as cover art.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]+ public bool EnableImageEnhancers { get; set; }++ public ImageRequest()+ {+ EnableImageEnhancers = true;+ }}/// <summary>diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.csindex 24fda11fc4..8656d75c0a 100644--- a/MediaBrowser.Api/Images/ImageService.cs+++ b/MediaBrowser.Api/Images/ImageService.cs@@ -1,6 +1,4 @@-using System.Drawing;-using System.Text;-using MediaBrowser.Common.Configuration;+using MediaBrowser.Common.Configuration;using MediaBrowser.Common.Extensions;using MediaBrowser.Common.IO;using MediaBrowser.Common.Net;@@ -17,6 +15,7 @@ using ServiceStack.ServiceHost;using ServiceStack.Text.Controller;using System;using System.Collections.Generic;+using System.Drawing;using System.IO;using System.Linq;using System.Threading;@@ -658,7 +657,7 @@ namespace MediaBrowser.Api.Images// See if we can avoid a file system lookup by looking for the file in ResolveArgsvar originalFileImageDateModified = kernel.ImageManager.GetImageDateModified(item, request.Type, index);- var supportedImageEnhancers = kernel.ImageManager.ImageEnhancers.Where(i =>+ var supportedImageEnhancers = request.EnableImageEnhancers ? kernel.ImageManager.ImageEnhancers.Where(i =>{try{@@ -671,7 +670,7 @@ namespace MediaBrowser.Api.Imagesreturn false;}- }).ToList();+ }).ToList() : new List<IImageEnhancer>();// If the file does not exist GetLastWriteTimeUtc will return jan 1, 1601 as opposed to throwing an exception// http://msdn.microsoft.com/en-us/library/system.io.file.getlastwritetimeutc.aspxdiff --git a/MediaBrowser.Controller/Dto/DtoBuilder.cs b/MediaBrowser.Controller/Dto/DtoBuilder.csindex 412b911f4f..6d5ae0326a 100644--- a/MediaBrowser.Controller/Dto/DtoBuilder.cs+++ b/MediaBrowser.Controller/Dto/DtoBuilder.cs@@ -182,6 +182,8 @@ namespace MediaBrowser.Controller.Dtoreturn;}+ dto.OriginalPrimaryImageAspectRatio = size.Width / size.Height;+var supportedEnhancers = Kernel.Instance.ImageManager.ImageEnhancers.Where(i =>{trydiff --git a/MediaBrowser.Model/DTO/BaseItemDto.cs b/MediaBrowser.Model/DTO/BaseItemDto.csindex 05f958f257..9bb91db7f8 100644--- a/MediaBrowser.Model/DTO/BaseItemDto.cs+++ b/MediaBrowser.Model/DTO/BaseItemDto.cs@@ -295,11 +295,17 @@ namespace MediaBrowser.Model.Dtopublic List<string> Tags { get; set; }/// <summary>- /// Gets or sets the primary image aspect ratio.+ /// Gets or sets the primary image aspect ratio, after image enhancements./// </summary>/// <value>The primary image aspect ratio.</value>public double? PrimaryImageAspectRatio { get; set; }+ /// <summary>+ /// Gets or sets the primary image aspect ratio, before image enhancements.+ /// </summary>+ /// <value>The original primary image aspect ratio.</value>+ public double? OriginalPrimaryImageAspectRatio { get; set; }+/// <summary>/// Gets or sets the artists./// </summary>diff --git a/MediaBrowser.Model/DTO/ImageOptions.cs b/MediaBrowser.Model/DTO/ImageOptions.csindex 68ca91ed00..45c4695ef2 100644--- a/MediaBrowser.Model/DTO/ImageOptions.cs+++ b/MediaBrowser.Model/DTO/ImageOptions.cs@@ -20,7 +20,7 @@ namespace MediaBrowser.Model.Dto/// </summary>/// <value>The index of the image.</value>public int? ImageIndex { get; set; }-+/// <summary>/// Gets or sets the width./// </summary>@@ -63,5 +63,16 @@ namespace MediaBrowser.Model.Dto/// </summary>/// <value><c>null</c> if [crop whitespace] contains no value, <c>true</c> if [crop whitespace]; otherwise, <c>false</c>.</value>public bool? CropWhitespace { get; set; }++ /// <summary>+ /// Gets or sets a value indicating whether [enable image enhancers].+ /// </summary>+ /// <value><c>true</c> if [enable image enhancers]; otherwise, <c>false</c>.</value>+ public bool EnableImageEnhancers { get; set; }++ public ImageOptions()+ {+ EnableImageEnhancers = true;+ }}}diff --git a/MediaBrowser.Model/DTO/UserDto.cs b/MediaBrowser.Model/DTO/UserDto.csindex bfd8d67cb1..a79ffc08c7 100644--- a/MediaBrowser.Model/DTO/UserDto.cs+++ b/MediaBrowser.Model/DTO/UserDto.cs@@ -58,6 +58,12 @@ namespace MediaBrowser.Model.Dto/// <value>The primary image aspect ratio.</value>public double? PrimaryImageAspectRatio { get; set; }+ /// <summary>+ /// Gets or sets the original primary image aspect ratio.+ /// </summary>+ /// <value>The original primary image aspect ratio.</value>+ public double? OriginalPrimaryImageAspectRatio { get; set; }+/// <summary>/// Gets a value indicating whether this instance has primary image./// </summary>diff --git a/MediaBrowser.Model/Dto/IItemDto.cs b/MediaBrowser.Model/Dto/IItemDto.csindex 3e7d1c6085..af46d29b9f 100644--- a/MediaBrowser.Model/Dto/IItemDto.cs+++ b/MediaBrowser.Model/Dto/IItemDto.cs@@ -11,5 +11,11 @@ namespace MediaBrowser.Model.Dto/// </summary>/// <value>The primary image aspect ratio.</value>double? PrimaryImageAspectRatio { get; set; }++ /// <summary>+ /// Gets or sets the original primary image aspect ratio.+ /// </summary>+ /// <value>The original primary image aspect ratio.</value>+ double? OriginalPrimaryImageAspectRatio { get; set; }}}diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspecindex b26510d8e9..2beaccd858 100644--- a/Nuget/MediaBrowser.Common.Internal.nuspec+++ b/Nuget/MediaBrowser.Common.Internal.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common.Internal</id>- <version>3.0.115</version>+ <version>3.0.117</version><title>MediaBrowser.Common.Internal</title><authors>Luke</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.115" />+ <dependency id="MediaBrowser.Common" version="3.0.117" /><dependency id="NLog" version="2.0.1.2" /><dependency id="ServiceStack.Text" version="3.9.45" /><dependency id="SimpleInjector" version="2.2.3" />diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspecindex df46643222..cbf5cb9b66 100644--- a/Nuget/MediaBrowser.Common.nuspec+++ b/Nuget/MediaBrowser.Common.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common</id>- <version>3.0.115</version>+ <version>3.0.117</version><title>MediaBrowser.Common</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspecindex 73376cd25c..090d527825 100644--- a/Nuget/MediaBrowser.Server.Core.nuspec+++ b/Nuget/MediaBrowser.Server.Core.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata><id>MediaBrowser.Server.Core</id>- <version>3.0.115</version>+ <version>3.0.117</version><title>Media Browser.Server.Core</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains core components required to build plugins for Media Browser Server.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.115" />+ <dependency id="MediaBrowser.Common" version="3.0.117" /></dependencies></metadata><files>