From 0788f435c185e6e5fa63b439d1e8d08e5ad89e13 Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Tue, 14 Aug 2012 15:06:25 -0400 Subject: Added GetItemsWithPerson --- MediaBrowser.ApiInteraction/ApiClient.cs | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.ApiInteraction') diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs index f8c9170a72..d1c9edf736 100644 --- a/MediaBrowser.ApiInteraction/ApiClient.cs +++ b/MediaBrowser.ApiInteraction/ApiClient.cs @@ -197,7 +197,7 @@ namespace MediaBrowser.ApiInteraction } /// - /// Gets a Year + /// Gets all items that contain a given Year /// public async Task>> GetItemsWithYearAsync(string name, Guid userId) { @@ -210,7 +210,7 @@ namespace MediaBrowser.ApiInteraction } /// - /// Gets a Genre + /// Gets all items that contain a given Genre /// public async Task>> GetItemsWithGenreAsync(string name, Guid userId) { @@ -222,6 +222,24 @@ namespace MediaBrowser.ApiInteraction } } + /// + /// Gets all items that contain a given Person + /// + public async Task>> GetItemsWithPersonAsync(string name, PersonType? personType, Guid userId) + { + string url = ApiUrl + "/itemswithgenre?userId=" + userId.ToString() + "&name=" + name; + + if (personType.HasValue) + { + url += "&persontype=" + personType.Value.ToString(); + } + + using (Stream stream = await HttpClient.GetStreamAsync(url)) + { + return JsonSerializer.DeserializeFromStream>>(stream); + } + } + /// /// Gets all studious /// @@ -249,7 +267,7 @@ namespace MediaBrowser.ApiInteraction } /// - /// Gets a Studio + /// Gets all items that contain a given Studio /// public async Task>> GetItemsWithStudioAsync(string name, Guid userId) { -- cgit v1.2.3