From 9c456c63c8d29301a36eb3bb5cbb5fa53688e0ee Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Sat, 18 Aug 2012 12:27:34 -0400 Subject: Added more IBN api methods --- MediaBrowser.ApiInteraction/ApiClient.cs | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'MediaBrowser.ApiInteraction') diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs index c30e677474..58ccb627c0 100644 --- a/MediaBrowser.ApiInteraction/ApiClient.cs +++ b/MediaBrowser.ApiInteraction/ApiClient.cs @@ -294,6 +294,58 @@ namespace MediaBrowser.ApiInteraction } } + /// + /// Gets a studio + /// + public async Task> GetStudioAsync(Guid userId, string name) + { + string url = ApiUrl + "/studio?userId=" + userId.ToString() + "&name=" + name; + + using (Stream stream = await HttpClient.GetStreamAsync(url)) + { + return JsonSerializer.DeserializeFromStream>(stream); + } + } + + /// + /// Gets a genre + /// + public async Task> GetGenreAsync(Guid userId, string name) + { + string url = ApiUrl + "/genre?userId=" + userId.ToString() + "&name=" + name; + + using (Stream stream = await HttpClient.GetStreamAsync(url)) + { + return JsonSerializer.DeserializeFromStream>(stream); + } + } + + /// + /// Gets a person + /// + public async Task> GetPersonAsync(Guid userId, string name) + { + string url = ApiUrl + "/person?userId=" + userId.ToString() + "&name=" + name; + + using (Stream stream = await HttpClient.GetStreamAsync(url)) + { + return JsonSerializer.DeserializeFromStream>(stream); + } + } + + /// + /// Gets a year + /// + public async Task> GetYearAsync(Guid userId, int year) + { + string url = ApiUrl + "/year?userId=" + userId.ToString() + "&year=" + year; + + using (Stream stream = await HttpClient.GetStreamAsync(url)) + { + return JsonSerializer.DeserializeFromStream>(stream); + } + } + public void Dispose() { HttpClient.Dispose(); -- cgit v1.2.3