updates upload method signature
This commit is contained in:
parent
523870fbe7
commit
d6aaefc0d2
@ -247,7 +247,7 @@ public class ImageApiTests : ApiTestsBase
|
|||||||
var bytes = Encoding.UTF8.GetBytes("PiwigoTestString");
|
var bytes = Encoding.UTF8.GetBytes("PiwigoTestString");
|
||||||
var expectedBase64 = Convert.ToBase64String(bytes);
|
var expectedBase64 = Convert.ToBase64String(bytes);
|
||||||
|
|
||||||
await _imageApi.AddChunkAsync(bytes, "origSum", 0);
|
await _imageApi.AddChunkAsync("origSum", 0, bytes);
|
||||||
|
|
||||||
CorrectMethodShouldGetCalled("pwg.images.addChunk");
|
CorrectMethodShouldGetCalled("pwg.images.addChunk");
|
||||||
|
|
||||||
|
@ -44,13 +44,13 @@ public interface IImageApi
|
|||||||
/// Adds a chunk of an image to piwigo.
|
/// Adds a chunk of an image to piwigo.
|
||||||
/// This enables uploading of large images using multiple chunks of data.
|
/// This enables uploading of large images using multiple chunks of data.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="data">The chunk to upload</param>
|
|
||||||
/// <param name="originalSum">The original image checksum</param>
|
/// <param name="originalSum">The original image checksum</param>
|
||||||
/// <param name="position">The chunk position</param>
|
/// <param name="position">The chunk position</param>
|
||||||
|
/// <param name="data">The chunk to upload</param>
|
||||||
/// <param name="cancellationToken">
|
/// <param name="cancellationToken">
|
||||||
/// <see cref="CancellationToken" />
|
/// <see cref="CancellationToken" />
|
||||||
/// </param>
|
/// </param>
|
||||||
Task AddChunkAsync(byte[] data, string originalSum, int position, CancellationToken cancellationToken = default);
|
Task AddChunkAsync(string originalSum, int position, byte[] data, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if piwigo is ready to get images uploaded.
|
/// Checks if piwigo is ready to get images uploaded.
|
||||||
|
@ -32,7 +32,7 @@ public class ImageApi : IImageApi
|
|||||||
return response.Result.Comment.Id;
|
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);
|
var base64Data = Convert.ToBase64String(data);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user