fix: fixed new tidal shit, changed accept header
This commit is contained in:
parent
aebe654c38
commit
fd7a274e82
@ -68,7 +68,7 @@ public class TidalService : ApiService
|
|||||||
url.Query = urlQuery.ToString();
|
url.Query = urlQuery.ToString();
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, url.Uri);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, url.Uri);
|
||||||
httpRequest.Content =
|
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);
|
var response = await client.SendAsync(httpRequest);
|
||||||
if (!response.IsSuccessStatusCode)
|
if (!response.IsSuccessStatusCode)
|
||||||
@ -124,7 +124,7 @@ public class TidalService : ApiService
|
|||||||
await JsonSerializer.DeserializeAsync<TidalTrackResponse>(await nameResponse.Content.ReadAsStreamAsync());
|
await JsonSerializer.DeserializeAsync<TidalTrackResponse>(await nameResponse.Content.ReadAsStreamAsync());
|
||||||
|
|
||||||
StringBuilder artists = new();
|
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));
|
var artistsResponse = await client.SendAsync(GetRequestMessage(client, data.Id, countryCode, true));
|
||||||
if (!artistsResponse.IsSuccessStatusCode)
|
if (!artistsResponse.IsSuccessStatusCode)
|
||||||
@ -158,7 +158,7 @@ public class TidalService : ApiService
|
|||||||
{
|
{
|
||||||
var clientHeaders = client.DefaultRequestHeaders;
|
var clientHeaders = client.DefaultRequestHeaders;
|
||||||
clientHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Token.Token);
|
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;
|
UriBuilder builder;
|
||||||
if (isArtist)
|
if (isArtist)
|
||||||
@ -183,7 +183,7 @@ public class TidalService : ApiService
|
|||||||
builder.Query = urlQuery.ToString();
|
builder.Query = urlQuery.ToString();
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, builder.Uri);
|
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;
|
return httpRequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,8 +10,6 @@
|
|||||||
"ServicesData": [
|
"ServicesData": [
|
||||||
{
|
{
|
||||||
"Name": "Spotify",
|
"Name": "Spotify",
|
||||||
"ClientId": "INSERT CLIENTID HERE",
|
|
||||||
"Secret": "INSERT SECRET HERE",
|
|
||||||
"Endpoints": {
|
"Endpoints": {
|
||||||
"Base": "https://open.spotify.com/",
|
"Base": "https://open.spotify.com/",
|
||||||
"Api": "https://api.spotify.com/v1/",
|
"Api": "https://api.spotify.com/v1/",
|
||||||
@ -28,8 +26,6 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "Tidal",
|
"Name": "Tidal",
|
||||||
"ClientId": "INSERT CLIENTID HERE",
|
|
||||||
"Secret": "INSERT SECRET HERE",
|
|
||||||
"Endpoints": {
|
"Endpoints": {
|
||||||
"Base": "https://tidal.com",
|
"Base": "https://tidal.com",
|
||||||
"Api": "https://openapi.tidal.com/v2/",
|
"Api": "https://openapi.tidal.com/v2/",
|
||||||
|
@ -182,6 +182,11 @@
|
|||||||
Json Structure for tidal track response
|
Json Structure for tidal track response
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:SWAD.API.Models.JsonStructures.MusicAPI.Tidal.TidalArtistResponse">
|
||||||
|
<summary>
|
||||||
|
Json Structure for tidal track response
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:SWAD.API.Models.JsonStructures.MusicAPI.Tidal.TidalTrackResponse">
|
<member name="T:SWAD.API.Models.JsonStructures.MusicAPI.Tidal.TidalTrackResponse">
|
||||||
<summary>
|
<summary>
|
||||||
Json Structure for tidal track response
|
Json Structure for tidal track response
|
||||||
|
@ -37,10 +37,6 @@
|
|||||||
<Content Update="telegramconfig.local.json">
|
<Content Update="telegramconfig.local.json">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<None Remove="telegramconfig.local.json" />
|
|
||||||
<Content Include="telegramconfig.local.json">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
23
docker-compose.dev.yaml
Normal file
23
docker-compose.dev.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
services:
|
||||||
|
portainer:
|
||||||
|
image: portainer/portainer-ce:latest
|
||||||
|
volumes:
|
||||||
|
- data:/data
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
api:
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
dockerfile: ./SWAD.API/Dockerfile
|
||||||
|
environment:
|
||||||
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
|
bot:
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
dockerfile: ./TelegramBot/Dockerfile
|
||||||
|
environment:
|
||||||
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
data:
|
Loading…
x
Reference in New Issue
Block a user