From 656a9ddaecc0888613b57de48d60102b19707ec6 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Fri, 15 Mar 2013 21:40:34 -0400 Subject: [PATCH] added Ids filter to ItemsService.cs --- MediaBrowser.Api/MediaBrowser.Api.csproj | 3 --- MediaBrowser.Api/UserLibrary/ItemsService.cs | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj index fc02410cc..58564fc90 100644 --- a/MediaBrowser.Api/MediaBrowser.Api.csproj +++ b/MediaBrowser.Api/MediaBrowser.Api.csproj @@ -140,9 +140,6 @@ - - - diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 9ed627999..e5e88b438 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -100,6 +100,13 @@ namespace MediaBrowser.Api.UserLibrary /// The image types. [ApiMember(Name = "ImageTypes", Description = "Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string ImageTypes { get; set; } + + /// + /// Gets or sets the item ids. + /// + /// 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; } } /// @@ -193,6 +200,13 @@ namespace MediaBrowser.Api.UserLibrary // Default list type = children + if (!string.IsNullOrEmpty(request.Ids)) + { + var idList = request.Ids.Split(',').ToList(); + + return idList.Select(i => DtoBuilder.GetItemByClientId(i, _userManager, _libraryManager, user.Id)); + } + if (request.Recursive) { return ((Folder)item).GetRecursiveChildren(user);