The Free Software Media System - Server Backend & API
added new video filters
Luke Pulverenti6e957cc0b05d
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.csindex a74516fa29..7c022af7ed 100644--- a/MediaBrowser.Api/UserLibrary/ItemsService.cs+++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs@@ -106,6 +106,27 @@ namespace MediaBrowser.Api.UserLibrary/// <value>The item ids.</value>[ApiMember(Name = "Ids", Description = "Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]public string Ids { get; set; }++ /// <summary>+ /// Gets or sets the media types.+ /// </summary>+ /// <value>The media types.</value>+ [ApiMember(Name = "MediaTypes", Description = "Optional filter by MediaType. Allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]+ public string MediaTypes { get; set; }++ /// <summary>+ /// Gets or sets the video types.+ /// </summary>+ /// <value>The video types.</value>+ [ApiMember(Name = "VideoTypes", Description = "Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]+ public string VideoTypes { get; set; }++ /// <summary>+ /// Gets or sets the video formats.+ /// </summary>+ /// <value>The video formats.</value>+ [ApiMember(Name = "VideoFormats", Description = "Optional filter by VideoFormat (Standard, Digital3D, Sbs3D). Allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]+ public string VideoFormats { get; set; }}/// <summary>@@ -315,6 +336,27 @@ namespace MediaBrowser.Api.UserLibrary/// <returns>IEnumerable{BaseItem}.</returns>private IEnumerable<BaseItem> ApplyAdditionalFilters(GetItems request, IEnumerable<BaseItem> items){+ if (!string.IsNullOrEmpty(request.VideoFormats))+ {+ var formats = request.VideoFormats.Split(',');++ items = items.OfType<Video>().Where(i => formats.Contains(i.VideoFormat.ToString(), StringComparer.OrdinalIgnoreCase));+ }++ if (!string.IsNullOrEmpty(request.VideoTypes))+ {+ var types = request.VideoTypes.Split(',');++ items = items.OfType<Video>().Where(i => types.Contains(i.VideoType.ToString(), StringComparer.OrdinalIgnoreCase));+ }++ if (!string.IsNullOrEmpty(request.MediaTypes))+ {+ var types = request.MediaTypes.Split(',');++ items = items.Where(i => !string.IsNullOrEmpty(i.MediaType) && types.Contains(i.MediaType, StringComparer.OrdinalIgnoreCase));+ }+var imageTypes = GetImageTypes(request).ToArray();if (imageTypes.Length > 0){diff --git a/MediaBrowser.Controller/Library/DtoBuilder.cs b/MediaBrowser.Controller/Library/DtoBuilder.csindex 6b28e0347f..f089b531cb 100644--- a/MediaBrowser.Controller/Library/DtoBuilder.cs+++ b/MediaBrowser.Controller/Library/DtoBuilder.cs@@ -548,6 +548,9 @@ namespace MediaBrowser.Controller.Library// Attach People by transforming them into BaseItemPerson (DTO)dto.People = new BaseItemPerson[item.People.Count];+ // Ordering by person type to ensure actors and artists are at the front.+ // This is taking advantage of the fact that they both begin with A+ // This should be improved in the futurevar entities = await Task.WhenAll(item.People.OrderBy(i => i.Type).Select(c =>Task.Run(async () =>diff --git a/MediaBrowser.Model/Querying/ItemQuery.cs b/MediaBrowser.Model/Querying/ItemQuery.csindex 804a6b3990..37024795ca 100644--- a/MediaBrowser.Model/Querying/ItemQuery.cs+++ b/MediaBrowser.Model/Querying/ItemQuery.cs@@ -57,6 +57,24 @@ namespace MediaBrowser.Model.Querying/// <value>The fields.</value>public ItemFields[] Fields { get; set; }+ /// <summary>+ /// Gets or sets the media types.+ /// </summary>+ /// <value>The media types.</value>+ public string[] MediaTypes { get; set; }++ /// <summary>+ /// Gets or sets the video formats.+ /// </summary>+ /// <value>The video formats.</value>+ public VideoFormat[] VideoFormats { get; set; }++ /// <summary>+ /// Gets or sets the video types.+ /// </summary>+ /// <value>The video types.</value>+ public VideoType[] VideoTypes { get; set; }+/// <summary>/// Whether or not to perform the query recursively/// </summary>diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspecindex ba481fc678..13a1ab540c 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.64</version>+ <version>3.0.65</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 Theatre 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.64" />+ <dependency id="MediaBrowser.Common" version="3.0.65" /><dependency id="NLog" version="2.0.0.2000" /><dependency id="ServiceStack.Text" version="3.9.38" /><dependency id="protobuf-net" version="2.0.0.621" />diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspecindex f2f25a02dd..085aefdf87 100644--- a/Nuget/MediaBrowser.Common.nuspec+++ b/Nuget/MediaBrowser.Common.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata><id>MediaBrowser.Common</id>- <version>3.0.64</version>+ <version>3.0.65</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 9b1f31365c..fac9b9296e 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.64</version>+ <version>3.0.65</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.64" />+ <dependency id="MediaBrowser.Common" version="3.0.65" /></dependencies></metadata><files>