fix: fixed new tidal shit, changed accept header
This commit is contained in:
@@ -68,7 +68,7 @@ public class TidalService : ApiService
|
||||
url.Query = urlQuery.ToString();
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, url.Uri);
|
||||
httpRequest.Content =
|
||||
new StringContent(string.Empty, new MediaTypeHeaderValue("application/vnd.tidal.v1+json"));
|
||||
new StringContent(string.Empty, new MediaTypeHeaderValue("application/vnd.api+json"));
|
||||
|
||||
var response = await client.SendAsync(httpRequest);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@@ -124,7 +124,7 @@ public class TidalService : ApiService
|
||||
await JsonSerializer.DeserializeAsync<TidalTrackResponse>(await nameResponse.Content.ReadAsStreamAsync());
|
||||
|
||||
StringBuilder artists = new();
|
||||
foreach (var data in trackJson?.Data.RelationShips.Artist.Data)
|
||||
foreach (var data in trackJson?.Data.RelationShips.Artist.Data ?? new())
|
||||
{
|
||||
var artistsResponse = await client.SendAsync(GetRequestMessage(client, data.Id, countryCode, true));
|
||||
if (!artistsResponse.IsSuccessStatusCode)
|
||||
@@ -158,7 +158,7 @@ public class TidalService : ApiService
|
||||
{
|
||||
var clientHeaders = client.DefaultRequestHeaders;
|
||||
clientHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Token.Token);
|
||||
clientHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/vnd.tidal.v1+json"));
|
||||
clientHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/vnd.api+json"));
|
||||
|
||||
UriBuilder builder;
|
||||
if (isArtist)
|
||||
@@ -183,7 +183,7 @@ public class TidalService : ApiService
|
||||
builder.Query = urlQuery.ToString();
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, builder.Uri);
|
||||
httpRequest.Content = new StringContent(string.Empty, Encoding.UTF8, "application/vnd.tidal.v1+json");
|
||||
httpRequest.Content = new StringContent(string.Empty, Encoding.UTF8, "application/vnd.api+json");
|
||||
return httpRequest;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user