aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ApiInteraction
diff options
context:
space:
mode:
authorLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-08-22 08:56:44 -0400
committerLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-08-22 08:56:44 -0400
commitf2de85b5d9d0dcc3c922bc261d32df71870d6615 (patch)
treec86b11cc193b56ce2be17882b8399e7b492d74af /MediaBrowser.ApiInteraction
parentfbf8cc833c441de8890998600be044296acfc783 (diff)
Added VideoInfo to DTOBaseItem
Diffstat (limited to 'MediaBrowser.ApiInteraction')
-rw-r--r--MediaBrowser.ApiInteraction/ApiClient.cs35
1 files changed, 20 insertions, 15 deletions
diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs
index f715e842e3..04a7ad2146 100644
--- a/MediaBrowser.ApiInteraction/ApiClient.cs
+++ b/MediaBrowser.ApiInteraction/ApiClient.cs
@@ -154,7 +154,7 @@ namespace MediaBrowser.ApiInteraction
/// </summary>
public Task<Stream> GetImageStreamAsync(string url)
{
- return HttpClient.GetStreamAsync(url);
+ return GetStreamAsync(url);
}
/// <summary>
@@ -169,7 +169,7 @@ namespace MediaBrowser.ApiInteraction
url += "&id=" + id.ToString();
}
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<DTOBaseItem>(stream);
}
@@ -182,7 +182,7 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/users";
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IEnumerable<User>>(stream);
}
@@ -195,7 +195,7 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/genres?userId=" + userId.ToString();
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IEnumerable<IBNItem<Genre>>>(stream);
}
@@ -208,7 +208,7 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/years?userId=" + userId.ToString();
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IEnumerable<IBNItem<Year>>>(stream);
}
@@ -221,7 +221,7 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/itemlist?listtype=itemswithyear&userId=" + userId.ToString() + "&name=" + name;
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IEnumerable<DTOBaseItem>>(stream);
}
@@ -234,7 +234,7 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/itemlist?listtype=itemswithgenre&userId=" + userId.ToString() + "&name=" + name;
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IEnumerable<DTOBaseItem>>(stream);
}
@@ -247,7 +247,7 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/itemlist?listtype=itemswithperson&userId=" + userId.ToString() + "&name=" + name;
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IEnumerable<DTOBaseItem>>(stream);
}
@@ -262,7 +262,7 @@ namespace MediaBrowser.ApiInteraction
url += "&persontype=" + personType;
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IEnumerable<DTOBaseItem>>(stream);
}
@@ -275,7 +275,7 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/studios?userId=" + userId.ToString();
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IEnumerable<IBNItem<Studio>>>(stream);
}
@@ -288,7 +288,7 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/itemlist?listtype=itemswithstudio&userId=" + userId.ToString() + "&name=" + name;
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IEnumerable<DTOBaseItem>>(stream);
}
@@ -301,7 +301,7 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/studio?userId=" + userId.ToString() + "&name=" + name;
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IBNItem<Studio>>(stream);
}
@@ -314,7 +314,7 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/genre?userId=" + userId.ToString() + "&name=" + name;
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IBNItem<Genre>>(stream);
}
@@ -327,7 +327,7 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/person?userId=" + userId.ToString() + "&name=" + name;
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IBNItem<Person>>(stream);
}
@@ -340,12 +340,17 @@ namespace MediaBrowser.ApiInteraction
{
string url = ApiUrl + "/year?userId=" + userId.ToString() + "&year=" + year;
- using (Stream stream = await HttpClient.GetStreamAsync(url).ConfigureAwait(false))
+ using (Stream stream = await GetStreamAsync(url).ConfigureAwait(false))
{
return JsonSerializer.DeserializeFromStream<IBNItem<Year>>(stream);
}
}
+ private Task<Stream> GetStreamAsync(string url)
+ {
+ return GetStreamAsync(url);
+ }
+
public void Dispose()
{
HttpClient.Dispose();