Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added is_hidden field to market.addalbum #1582

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions VkNet/Abstractions/Category/Async/IMarketsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,9 @@ Task<bool> ReorderAlbumsAsync(long ownerId,
/// значения 1 или 0
/// (флаг, может принимать значения 1 или 0).
/// </param>
/// <param name="isHidden">
/// Информация о том, сделать ли подборку скрытой. 0 - не делать скрытой(по умолчанию). 1 - скрыть подборку
/// </param>
/// <param name="token">Токен отмены операции</param>
/// <returns>
/// После успешного выполнения возвращает идентификатор созданной подборки.
Expand All @@ -575,6 +578,7 @@ Task<long> AddAlbumAsync(long ownerId,
string title,
long? photoId = null,
bool mainAlbum = false,
bool isHidden = false,
CancellationToken token = default);

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Abstractions/Category/IMarketsCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public interface IMarketsCategory : IMarketsCategoryAsync
bool ReorderAlbums(long ownerId, long albumId, long? before = null, long? after = null);

/// <inheritdoc cref="IMarketsCategoryAsync.AddAlbumAsync"/>
long AddAlbum(long ownerId, string title, long? photoId = null, bool mainAlbum = false);
long AddAlbum(long ownerId, string title, long? photoId = null, bool mainAlbum = false, bool isHidden = false);

/// <inheritdoc cref="IMarketsCategoryAsync.EditAlbumAsync"/>
bool EditAlbum(long ownerId, long albumId, string title, long? photoId = null, bool mainAlbum = false, bool isHidden = false);
Expand Down
3 changes: 2 additions & 1 deletion VkNet/Categories/Async/MarketsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
bool extended = false,
CancellationToken token = default) =>
TypeHelper.TryInvokeMethodAsync(() =>
Get(ownerId, albumId, count, offset, extended), token);

Check warning on line 27 in VkNet/Categories/Async/MarketsCategoryAsync.cs

View workflow job for this annotation

GitHub Actions / build

'MarketsCategory.Get(long, long?, int?, int?, bool)' is obsolete: 'This method is deprecated. Use Get(MarketGetParams @params) instead'

/// <inheritdoc />
public Task<VkCollection<Market>> GetByIdAsync(IEnumerable<string> itemIds,
Expand Down Expand Up @@ -155,9 +155,10 @@
string title,
long? photoId = null,
bool mainAlbum = false,
bool isHidden = false,
CancellationToken token = default) =>
TypeHelper.TryInvokeMethodAsync(() =>
AddAlbum(ownerId, title, photoId, mainAlbum), token);
AddAlbum(ownerId, title, photoId, mainAlbum, isHidden), token);

/// <inheritdoc />
public Task<bool> EditAlbumAsync(long ownerId,
Expand Down
5 changes: 4 additions & 1 deletion VkNet/Categories/MarketsCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ public bool ReorderAlbums(long ownerId, long albumId, long? before = null, long?
}

/// <inheritdoc />
public long AddAlbum(long ownerId, string title, long? photoId = null, bool mainAlbum = false)
public long AddAlbum(long ownerId, string title, long? photoId = null, bool mainAlbum = false, bool isHidden = false)
{
var parameters = new VkParameters
{
Expand All @@ -533,6 +533,9 @@ public long AddAlbum(long ownerId, string title, long? photoId = null, bool main
},
{
"main_album", mainAlbum
},
{
"is_hidden", isHidden
}
};

Expand Down
Loading