Полностью переписанное api
All checks were successful
Release / pack-and-publish (release) Successful in 36s

This commit is contained in:
FrigaT
2026-04-19 17:00:05 +03:00
parent 5541d0ad27
commit 36e28ce3fe
111 changed files with 1552 additions and 3358 deletions

View File

@@ -1,30 +1,19 @@
using System.Collections.Specialized;
using System.Net;
using System.Net.Http.Headers;
using YandexMusic.API.Common;
using YandexMusic.API.Models.Account;
using YandexMusic.API.Requests.Common;
using YandexMusic.API.Requests.Common.Attributes;
namespace YandexMusic.API.Requests.Account;
[YMobileProxyRequest(WebRequestMethods.Http.Get, "/1/bundle/account/short_info/")]
internal class YGetShortAccountInifoBuilder : YRequestBuilder<YShortAccountInfo, object>
public class YGetShortAccountInfoBuilder : YAuthRequestBuilder<YShortAccountInfo?, object>
{
public YGetShortAccountInifoBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
{
}
protected override NameValueCollection GetQueryParams(object tuple)
{
return new NameValueCollection {
{ "avatar_size", "islands-300" }
};
}
public YGetShortAccountInfoBuilder(YandexMusicApi api) : base(api) { }
protected override string Method => WebRequestMethods.Http.Get;
protected override string PathTemplate => "1/bundle/account/short_info/";
protected override NameValueCollection GetQueryParams(object _)
=> new() { { "avatar_size", "islands-300" } };
protected override void SetCustomHeaders(HttpRequestHeaders headers)
{
headers.Add("Ya-Consumer-Authorization", $"OAuth {storage.AccessToken.AccessToken}");
headers.Add("Ya-Consumer-Authorization", $"OAuth {Api.Storage.AccessToken.AccessToken}");
}
}