mirror of https://github.com/jellyfin/jellyfin.git
added new image params
This commit is contained in:
parent
2852e037d2
commit
ad1a9a4932
|
@ -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")]
|
[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; }
|
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; }
|
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>
|
/// <summary>
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using System.Drawing;
|
using MediaBrowser.Common.Configuration;
|
||||||
using System.Text;
|
|
||||||
using MediaBrowser.Common.Configuration;
|
|
||||||
using MediaBrowser.Common.Extensions;
|
using MediaBrowser.Common.Extensions;
|
||||||
using MediaBrowser.Common.IO;
|
using MediaBrowser.Common.IO;
|
||||||
using MediaBrowser.Common.Net;
|
using MediaBrowser.Common.Net;
|
||||||
|
@ -17,6 +15,7 @@ using ServiceStack.ServiceHost;
|
||||||
using ServiceStack.Text.Controller;
|
using ServiceStack.Text.Controller;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
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 ResolveArgs
|
// See if we can avoid a file system lookup by looking for the file in ResolveArgs
|
||||||
var originalFileImageDateModified = kernel.ImageManager.GetImageDateModified(item, request.Type, index);
|
var 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
|
try
|
||||||
{
|
{
|
||||||
|
@ -671,7 +670,7 @@ namespace MediaBrowser.Api.Images
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}).ToList();
|
}).ToList() : new List<IImageEnhancer>();
|
||||||
|
|
||||||
// If the file does not exist GetLastWriteTimeUtc will return jan 1, 1601 as opposed to throwing an exception
|
// 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.aspx
|
// http://msdn.microsoft.com/en-us/library/system.io.file.getlastwritetimeutc.aspx
|
||||||
|
|
|
@ -182,6 +182,8 @@ namespace MediaBrowser.Controller.Dto
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dto.OriginalPrimaryImageAspectRatio = size.Width / size.Height;
|
||||||
|
|
||||||
var supportedEnhancers = Kernel.Instance.ImageManager.ImageEnhancers.Where(i =>
|
var supportedEnhancers = Kernel.Instance.ImageManager.ImageEnhancers.Where(i =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -295,11 +295,17 @@ namespace MediaBrowser.Model.Dto
|
||||||
public List<string> Tags { get; set; }
|
public List<string> Tags { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the primary image aspect ratio.
|
/// Gets or sets the primary image aspect ratio, after image enhancements.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The primary image aspect ratio.</value>
|
/// <value>The primary image aspect ratio.</value>
|
||||||
public double? PrimaryImageAspectRatio { get; set; }
|
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>
|
/// <summary>
|
||||||
/// Gets or sets the artists.
|
/// Gets or sets the artists.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -63,5 +63,16 @@ namespace MediaBrowser.Model.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value><c>null</c> if [crop whitespace] contains no value, <c>true</c> if [crop whitespace]; otherwise, <c>false</c>.</value>
|
/// <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; }
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,12 @@ namespace MediaBrowser.Model.Dto
|
||||||
/// <value>The primary image aspect ratio.</value>
|
/// <value>The primary image aspect ratio.</value>
|
||||||
public double? PrimaryImageAspectRatio { get; set; }
|
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>
|
/// <summary>
|
||||||
/// Gets a value indicating whether this instance has primary image.
|
/// Gets a value indicating whether this instance has primary image.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -11,5 +11,11 @@ namespace MediaBrowser.Model.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The primary image aspect ratio.</value>
|
/// <value>The primary image aspect ratio.</value>
|
||||||
double? PrimaryImageAspectRatio { get; set; }
|
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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common.Internal</id>
|
<id>MediaBrowser.Common.Internal</id>
|
||||||
<version>3.0.115</version>
|
<version>3.0.117</version>
|
||||||
<title>MediaBrowser.Common.Internal</title>
|
<title>MediaBrowser.Common.Internal</title>
|
||||||
<authors>Luke</authors>
|
<authors>Luke</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<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>
|
<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>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<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="NLog" version="2.0.1.2" />
|
||||||
<dependency id="ServiceStack.Text" version="3.9.45" />
|
<dependency id="ServiceStack.Text" version="3.9.45" />
|
||||||
<dependency id="SimpleInjector" version="2.2.3" />
|
<dependency id="SimpleInjector" version="2.2.3" />
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common</id>
|
<id>MediaBrowser.Common</id>
|
||||||
<version>3.0.115</version>
|
<version>3.0.117</version>
|
||||||
<title>MediaBrowser.Common</title>
|
<title>MediaBrowser.Common</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Server.Core</id>
|
<id>MediaBrowser.Server.Core</id>
|
||||||
<version>3.0.115</version>
|
<version>3.0.117</version>
|
||||||
<title>Media Browser.Server.Core</title>
|
<title>Media Browser.Server.Core</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||||
<copyright>Copyright © Media Browser 2013</copyright>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.115" />
|
<dependency id="MediaBrowser.Common" version="3.0.117" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|
Loading…
Reference in New Issue