From d6aaefc0d2ef34bca91de64c38656c8d0ac769ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=A4felfinger?= Date: Tue, 15 Nov 2022 23:30:27 +0100 Subject: [PATCH] updates upload method signature --- src/Piwigo.Client.Tests/ImageApiTests.cs | 2 +- src/Piwigo.Client/Images/IImageApi.cs | 4 ++-- src/Piwigo.Client/Images/ImageApi.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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);