diff --git a/src/Piwigo.Client.Tests/ImageApiTests.cs b/src/Piwigo.Client.Tests/ImageApiTests.cs index 231acbf..c79863e 100644 --- a/src/Piwigo.Client.Tests/ImageApiTests.cs +++ b/src/Piwigo.Client.Tests/ImageApiTests.cs @@ -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"); diff --git a/src/Piwigo.Client/Images/IImageApi.cs b/src/Piwigo.Client/Images/IImageApi.cs index 9186a7d..d89e106 100644 --- a/src/Piwigo.Client/Images/IImageApi.cs +++ b/src/Piwigo.Client/Images/IImageApi.cs @@ -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. /// - /// The chunk to upload /// The original image checksum /// The chunk position + /// The chunk to upload /// /// /// - Task AddChunkAsync(byte[] data, string originalSum, int position, CancellationToken cancellationToken = default); + Task AddChunkAsync(string originalSum, int position, byte[] data, CancellationToken cancellationToken = default); /// /// Checks if piwigo is ready to get images uploaded. diff --git a/src/Piwigo.Client/Images/ImageApi.cs b/src/Piwigo.Client/Images/ImageApi.cs index 50443d8..a5a94af 100644 --- a/src/Piwigo.Client/Images/ImageApi.cs +++ b/src/Piwigo.Client/Images/ImageApi.cs @@ -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);