fix: fixed tidal resolve of tracks, some cleanup
This commit is contained in:
parent
4a95ba0d86
commit
362284528c
@ -64,6 +64,7 @@ public class TidalService : ApiService
|
|||||||
//TODO: придумать что-то с этим
|
//TODO: придумать что-то с этим
|
||||||
urlQuery["countryCode"] = "US";
|
urlQuery["countryCode"] = "US";
|
||||||
urlQuery["include"] = "tracks";
|
urlQuery["include"] = "tracks";
|
||||||
|
urlQuery["explicitFilter"] = "include";
|
||||||
|
|
||||||
url.Query = urlQuery.ToString();
|
url.Query = urlQuery.ToString();
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, url.Uri);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, url.Uri);
|
||||||
|
@ -89,7 +89,7 @@ public class YandexService : ApiService
|
|||||||
var artists = string.Join(", ", json!.Artists.ToList().ConvertAll(x => x.Name));
|
var artists = string.Join(", ", json!.Artists.ToList().ConvertAll(x => x.Name));
|
||||||
return new TrackDto(json.Track.Title, artists, json.Track.Albums[0].Title, ServiceType);
|
return new TrackDto(json.Track.Title, artists, json.Track.Albums[0].Title, ServiceType);
|
||||||
}
|
}
|
||||||
catch (JsonException ex)
|
catch (JsonException)
|
||||||
{
|
{
|
||||||
throw new TooManyRequestsException("Яндекс, похоже, считает что мы робот, что по сути является правдой. Попробуйте позже.");
|
throw new TooManyRequestsException("Яндекс, похоже, считает что мы робот, что по сути является правдой. Попробуйте позже.");
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"APIPaths": {
|
"APIPaths": {
|
||||||
"Search": "searchresults",
|
"Search": "searchResults",
|
||||||
"GetTrack": "tracks",
|
"GetTrack": "tracks",
|
||||||
"GetArtist": "artists"
|
"GetArtist": "artists"
|
||||||
}
|
}
|
||||||
|
@ -83,13 +83,12 @@ public class LinkMessage : IMessage
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
await botClient.AnswerInlineQueryAsync(update.InlineQuery.Id,
|
await botClient.AnswerInlineQueryAsync(update.InlineQuery.Id,
|
||||||
new[]
|
[
|
||||||
{
|
|
||||||
new InlineQueryResultArticle("0", message.preview!,
|
new InlineQueryResultArticle("0", message.preview!,
|
||||||
new InputTextMessageContent(message.message))
|
new InputTextMessageContent(message.message))
|
||||||
}, cancellationToken: cancellationToken);
|
], cancellationToken: cancellationToken);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Failed to send answer to {update.Message?.Chat.Username}");
|
Console.WriteLine($"Failed to send answer to {update.Message?.Chat.Username}");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user