aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ApiInteraction/ApiClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.ApiInteraction/ApiClient.cs')
-rw-r--r--MediaBrowser.ApiInteraction/ApiClient.cs24
1 files changed, 21 insertions, 3 deletions
diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs
index f8c9170a7..d1c9edf73 100644
--- a/MediaBrowser.ApiInteraction/ApiClient.cs
+++ b/MediaBrowser.ApiInteraction/ApiClient.cs
@@ -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)
{
@@ -223,6 +223,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>
public async Task<IEnumerable<CategoryInfo<Studio>>> GetAllStudiosAsync(Guid userId)
@@ -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)
{