Added GetItemsWithPerson

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-08-14 15:06:25 -04:00
parent ee1fa6e816
commit 0788f435c1
6 changed files with 83 additions and 5 deletions

View File

@@ -197,7 +197,7 @@ namespace MediaBrowser.ApiInteraction
}
/// <summary>
/// Gets a Year
/// Gets all items that contain a given Year
/// </summary>
public async Task<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>> GetItemsWithYearAsync(string name, Guid userId)
{
@@ -210,7 +210,7 @@ namespace MediaBrowser.ApiInteraction
}
/// <summary>
/// Gets a Genre
/// Gets all items that contain a given Genre
/// </summary>
public async Task<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>> GetItemsWithGenreAsync(string name, Guid userId)
{
@@ -222,6 +222,24 @@ namespace MediaBrowser.ApiInteraction
}
}
/// <summary>
/// Gets all items that contain a given Person
/// </summary>
public async Task<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>> 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<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>>(stream);
}
}
/// <summary>
/// Gets all studious
/// </summary>
@@ -249,7 +267,7 @@ namespace MediaBrowser.ApiInteraction
}
/// <summary>
/// Gets a Studio
/// Gets all items that contain a given Studio
/// </summary>
public async Task<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>> GetItemsWithStudioAsync(string name, Guid userId)
{