mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-04 23:08:42 +01:00
added cancellation token to get image stream
This commit is contained in:
23
MediaBrowser.Model/ApiClient/ApiClientExtensions.cs
Normal file
23
MediaBrowser.Model/ApiClient/ApiClientExtensions.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user