From 6e957cc0b05d4c5b15bbf309e7bf1e93abe442a4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 4 Apr 2013 11:22:39 -0400 Subject: [PATCH] added new video filters --- MediaBrowser.Api/UserLibrary/ItemsService.cs | 42 +++++++++++++++++++ MediaBrowser.Controller/Library/DtoBuilder.cs | 3 ++ MediaBrowser.Model/Querying/ItemQuery.cs | 18 ++++++++ Nuget/MediaBrowser.Common.Internal.nuspec | 4 +- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 +- 6 files changed, 68 insertions(+), 5 deletions(-) diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index a74516fa29..7c022af7ed 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -106,6 +106,27 @@ namespace MediaBrowser.Api.UserLibrary /// The item ids. [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; } + + /// + /// Gets or sets the media types. + /// + /// The media types. + [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; } + + /// + /// Gets or sets the video types. + /// + /// The video types. + [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; } + + /// + /// Gets or sets the video formats. + /// + /// The video formats. + [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; } } /// @@ -315,6 +336,27 @@ namespace MediaBrowser.Api.UserLibrary /// IEnumerable{BaseItem}. private IEnumerable ApplyAdditionalFilters(GetItems request, IEnumerable items) { + if (!string.IsNullOrEmpty(request.VideoFormats)) + { + var formats = request.VideoFormats.Split(','); + + items = items.OfType