adds set rank
This commit is contained in:
parent
23fc948424
commit
5d58aaee1c
@ -24,7 +24,6 @@ public class AlbumApiTests : ApiTestsBase
|
||||
CorrectParamShouldGetSent("category_id", "1");
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public async Task RefreshRepresentative_should_call_api()
|
||||
{
|
||||
@ -46,6 +45,17 @@ public class AlbumApiTests : ApiTestsBase
|
||||
CorrectParamShouldGetSent("image_id", "2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task SetRank_should_call_api()
|
||||
{
|
||||
SetOkResult();
|
||||
await _albumApi.SetRankAsync(1, 2);
|
||||
|
||||
CorrectMethodShouldGetCalled("pwg.categories.setRank");
|
||||
CorrectParamShouldGetSent("category_id", "1");
|
||||
CorrectParamShouldGetSent("rank", "2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Delete_should_remove_album()
|
||||
{
|
||||
|
@ -33,6 +33,12 @@ public class AlbumApi : IAlbumApi
|
||||
await _context.PostAsync<PiwigoResponse>(_logger, "pwg.categories.setRepresentative", formParams, cancellationToken);
|
||||
}
|
||||
|
||||
public async Task SetRankAsync(int albumId, int rank, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var formParams = new Dictionary<string, string> { { "category_id", albumId.ToString() }, { "rank", rank.ToString() } };
|
||||
await _context.PostAsync<PiwigoResponse>(_logger, "pwg.categories.setRank", formParams, cancellationToken);
|
||||
}
|
||||
|
||||
public async Task<AlbumOrphans> CalculateOrphansAsync(int albumId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var formParams = new Dictionary<string, string> { { "category_id", albumId.ToString() } };
|
||||
|
@ -14,6 +14,8 @@ public interface IAlbumApi
|
||||
|
||||
Task SetRepresentativeAsync(int albumId, int imageId, CancellationToken cancellationToken = default);
|
||||
|
||||
Task SetRankAsync(int albumId, int rank, CancellationToken cancellationToken = default);
|
||||
|
||||
Task<int> AddAsync(string name, int? parentId = null, string? comment = null, bool? visible = null, CategoryStatus? status = null, bool? commentable = null,
|
||||
CategoryPosition? position = null, CancellationToken cancellationToken = default);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user