From 032f3d376b3818bdff98512229fb96fdfd9f37bb Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 6 Sep 2013 01:13:43 -0400 Subject: added more sorting to ibn endpoints --- MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs') diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs index bc096f67c..f1bb56b16 100644 --- a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs +++ b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs @@ -79,6 +79,13 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "MediaTypes", Description = "Optional filter by MediaType. Allows multiple, comma delimited.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string MediaTypes { get; set; } + /// + /// Gets or sets the image types. + /// + /// The image types. + [ApiMember(Name = "ImageTypes", Description = "Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + public string ImageTypes { get; set; } + /// /// Gets the filters. /// @@ -120,5 +127,21 @@ namespace MediaBrowser.Api.UserLibrary }).Where(i => i.HasValue).Select(i => i.Value); } + + /// + /// Gets the image types. + /// + /// IEnumerable{ImageType}. + public IEnumerable GetImageTypes() + { + var val = ImageTypes; + + if (string.IsNullOrEmpty(val)) + { + return new ImageType[] { }; + } + + return val.Split(',').Select(v => (ImageType)Enum.Parse(typeof(ImageType), v, true)); + } } } -- cgit v1.2.3