Skip to content

Commit

Permalink
Rename GetImageBytes, fixes jellyfin#375
Browse files Browse the repository at this point in the history
  • Loading branch information
LordMike committed Apr 26, 2021
1 parent 08e7544 commit 2d3d2d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion TMDbLib/Client/TMDbClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,13 @@ public Uri GetImageUrl(string size, string filePath, bool useSsl = false)
return new Uri(baseUrl + size + filePath);
}

public async Task<byte[]> GetImageBytes(string size, string filePath, bool useSsl = false, CancellationToken token = default)
[Obsolete("Use " + nameof(GetImageBytesAsync))]
public Task<byte[]> GetImageBytes(string size, string filePath, bool useSsl = false, CancellationToken token = default)
{
return GetImageBytesAsync(size, filePath, useSsl, token);
}

public async Task<byte[]> GetImageBytesAsync(string size, string filePath, bool useSsl = false, CancellationToken token = default)
{
Uri url = GetImageUrl(size, filePath, useSsl);

Expand Down
2 changes: 1 addition & 1 deletion TestApplication/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private static async Task ProcessImages(TMDbClient client, IEnumerable<ImageData
Console.WriteLine("Downloading image for the first url, as a test");

Uri testUrl = client.GetImageUrl(sizesLst.First(), imagesLst.First().FilePath);
byte[] bts = await client.GetImageBytes(sizesLst.First(), imagesLst.First().FilePath);
byte[] bts = await client.GetImageBytesAsync(sizesLst.First(), imagesLst.First().FilePath);

Console.WriteLine($"Downloaded {testUrl}: {bts.Length} bytes");
}
Expand Down

0 comments on commit 2d3d2d4

Please sign in to comment.