updates upload method signature

This commit is contained in:
Philipp Häfelfinger 2022-11-15 23:30:27 +01:00
parent 523870fbe7
commit d6aaefc0d2
3 changed files with 4 additions and 4 deletions

View File

@ -247,7 +247,7 @@ public class ImageApiTests : ApiTestsBase
var bytes = Encoding.UTF8.GetBytes("PiwigoTestString");
var expectedBase64 = Convert.ToBase64String(bytes);
await _imageApi.AddChunkAsync(bytes, "origSum", 0);
await _imageApi.AddChunkAsync("origSum", 0, bytes);
CorrectMethodShouldGetCalled("pwg.images.addChunk");

View File

@ -44,13 +44,13 @@ public interface IImageApi
/// Adds a chunk of an image to piwigo.
/// This enables uploading of large images using multiple chunks of data.
/// </summary>
/// <param name="data">The chunk to upload</param>
/// <param name="originalSum">The original image checksum</param>
/// <param name="position">The chunk position</param>
/// <param name="data">The chunk to upload</param>
/// <param name="cancellationToken">
/// <see cref="CancellationToken" />
/// </param>
Task AddChunkAsync(byte[] data, string originalSum, int position, CancellationToken cancellationToken = default);
Task AddChunkAsync(string originalSum, int position, byte[] data, CancellationToken cancellationToken = default);
/// <summary>
/// Checks if piwigo is ready to get images uploaded.

View File

@ -32,7 +32,7 @@ public class ImageApi : IImageApi
return response.Result.Comment.Id;
}
public async Task AddChunkAsync(byte[] data, string originalSum, int position, CancellationToken cancellationToken = default)
public async Task AddChunkAsync(string originalSum, int position, byte[] data, CancellationToken cancellationToken = default)
{
var base64Data = Convert.ToBase64String(data);