From 362284528cde196981636a61f9a5dac586860656 Mon Sep 17 00:00:00 2001 From: Lisoveliy Date: Mon, 7 Jul 2025 18:14:33 +0300 Subject: [PATCH] fix: fixed tidal resolve of tracks, some cleanup --- SWAD.API/Services/MusicAPI/Api/TidalService.cs | 1 + SWAD.API/Services/MusicAPI/Api/YandexService.cs | 2 +- SWAD.API/appsettings.json | 2 +- TelegramBot/Commands/LinkMessage.cs | 7 +++---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SWAD.API/Services/MusicAPI/Api/TidalService.cs b/SWAD.API/Services/MusicAPI/Api/TidalService.cs index 10b82dd..e743661 100644 --- a/SWAD.API/Services/MusicAPI/Api/TidalService.cs +++ b/SWAD.API/Services/MusicAPI/Api/TidalService.cs @@ -64,6 +64,7 @@ public class TidalService : ApiService //TODO: придумать что-то с этим urlQuery["countryCode"] = "US"; urlQuery["include"] = "tracks"; + urlQuery["explicitFilter"] = "include"; url.Query = urlQuery.ToString(); var httpRequest = new HttpRequestMessage(HttpMethod.Get, url.Uri); diff --git a/SWAD.API/Services/MusicAPI/Api/YandexService.cs b/SWAD.API/Services/MusicAPI/Api/YandexService.cs index 2d17384..2dcc800 100644 --- a/SWAD.API/Services/MusicAPI/Api/YandexService.cs +++ b/SWAD.API/Services/MusicAPI/Api/YandexService.cs @@ -89,7 +89,7 @@ public class YandexService : ApiService var artists = string.Join(", ", json!.Artists.ToList().ConvertAll(x => x.Name)); return new TrackDto(json.Track.Title, artists, json.Track.Albums[0].Title, ServiceType); } - catch (JsonException ex) + catch (JsonException) { throw new TooManyRequestsException("Яндекс, похоже, считает что мы робот, что по сути является правдой. Попробуйте позже."); } diff --git a/SWAD.API/appsettings.json b/SWAD.API/appsettings.json index a0c36bb..c223668 100644 --- a/SWAD.API/appsettings.json +++ b/SWAD.API/appsettings.json @@ -36,7 +36,7 @@ ] }, "APIPaths": { - "Search": "searchresults", + "Search": "searchResults", "GetTrack": "tracks", "GetArtist": "artists" } diff --git a/TelegramBot/Commands/LinkMessage.cs b/TelegramBot/Commands/LinkMessage.cs index c607820..47b9d2a 100644 --- a/TelegramBot/Commands/LinkMessage.cs +++ b/TelegramBot/Commands/LinkMessage.cs @@ -83,13 +83,12 @@ public class LinkMessage : IMessage try { await botClient.AnswerInlineQueryAsync(update.InlineQuery.Id, - new[] - { + [ new InlineQueryResultArticle("0", message.preview!, new InputTextMessageContent(message.message)) - }, cancellationToken: cancellationToken); + ], cancellationToken: cancellationToken); } - catch (Exception e) + catch (Exception) { Console.WriteLine($"Failed to send answer to {update.Message?.Chat.Username}"); }