using System.Net; using YandexMusic.API.Models.Library; namespace YandexMusic.API.Requests.Library; public class YLibraryAddBuilder : YMusicRequestBuilder { public YLibraryAddBuilder(YandexMusicApi api) : base(api) { } protected override string Method => WebRequestMethods.Http.Post; protected override string PathTemplate => "users/{uid}/{type}/{section}/add-multiple"; protected override Dictionary GetSubstitutions((string id, YLibrarySection section, YLibrarySectionType type) tuple) => new() { { "uid", Api.Storage.User.Uid }, { "type", tuple.type.ToString().ToLower() }, { "section", tuple.section.ToString().ToLower() } }; protected override HttpContent? GetContent((string id, YLibrarySection section, YLibrarySectionType type) tuple) => new FormUrlEncodedContent(new Dictionary { { $"{tuple.section.ToString().ToLower().TrimEnd('s')}-ids", tuple.id } }); }