2013-08-12 19:13:36 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
2013-08-21 20:08:42 +00:00
|
|
|
|
using MediaBrowser.Model.Dto;
|
2013-08-12 19:13:36 +00:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Model.ApiClient
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Class ApiClientExtensions
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class ApiClientExtensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the image stream async.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="apiClient">The API client.</param>
|
|
|
|
|
/// <param name="url">The URL.</param>
|
|
|
|
|
/// <returns>Task{Stream}.</returns>
|
|
|
|
|
public static Task<Stream> GetImageStreamAsync(this IApiClient apiClient, string url)
|
|
|
|
|
{
|
|
|
|
|
return apiClient.GetImageStreamAsync(url, CancellationToken.None);
|
|
|
|
|
}
|
2013-08-21 20:08:42 +00:00
|
|
|
|
|
|
|
|
|
public static Task<UserDto[]> GetPublicUsersAsync(this IApiClient apiClient)
|
|
|
|
|
{
|
|
|
|
|
return apiClient.GetPublicUsersAsync(CancellationToken.None);
|
|
|
|
|
}
|
2013-08-12 19:13:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|