diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-18 12:27:34 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-18 12:27:34 -0400 |
| commit | 9c456c63c8d29301a36eb3bb5cbb5fa53688e0ee (patch) | |
| tree | baaa6f2ed6b824c226f806430fdc01dbe9ed0bc2 /MediaBrowser.ApiInteraction | |
| parent | d4d2e854869e7cc34965a38f6248a364c06974e0 (diff) | |
Added more IBN api methods
Diffstat (limited to 'MediaBrowser.ApiInteraction')
| -rw-r--r-- | MediaBrowser.ApiInteraction/ApiClient.cs | 52 |
1 files changed, 52 insertions, 0 deletions
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 }
}
+ /// <summary>
+ /// Gets a studio
+ /// </summary>
+ public async Task<IBNItem<Studio>> GetStudioAsync(Guid userId, string name)
+ {
+ string url = ApiUrl + "/studio?userId=" + userId.ToString() + "&name=" + name;
+
+ using (Stream stream = await HttpClient.GetStreamAsync(url))
+ {
+ return JsonSerializer.DeserializeFromStream<IBNItem<Studio>>(stream);
+ }
+ }
+
+ /// <summary>
+ /// Gets a genre
+ /// </summary>
+ public async Task<IBNItem<Genre>> GetGenreAsync(Guid userId, string name)
+ {
+ string url = ApiUrl + "/genre?userId=" + userId.ToString() + "&name=" + name;
+
+ using (Stream stream = await HttpClient.GetStreamAsync(url))
+ {
+ return JsonSerializer.DeserializeFromStream<IBNItem<Genre>>(stream);
+ }
+ }
+
+ /// <summary>
+ /// Gets a person
+ /// </summary>
+ public async Task<IBNItem<Person>> GetPersonAsync(Guid userId, string name)
+ {
+ string url = ApiUrl + "/person?userId=" + userId.ToString() + "&name=" + name;
+
+ using (Stream stream = await HttpClient.GetStreamAsync(url))
+ {
+ return JsonSerializer.DeserializeFromStream<IBNItem<Person>>(stream);
+ }
+ }
+
+ /// <summary>
+ /// Gets a year
+ /// </summary>
+ public async Task<IBNItem<Year>> GetYearAsync(Guid userId, int year)
+ {
+ string url = ApiUrl + "/year?userId=" + userId.ToString() + "&year=" + year;
+
+ using (Stream stream = await HttpClient.GetStreamAsync(url))
+ {
+ return JsonSerializer.DeserializeFromStream<IBNItem<Year>>(stream);
+ }
+ }
+
public void Dispose()
{
HttpClient.Dispose();
|
