Skip to content

Commit

Permalink
Fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
skuill committed May 21, 2023
1 parent d0bcb2b commit 50b0bf5
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions LyricsScraperNET/Providers/Musixmatch/MusixmatchProvider.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using LyricsScraperNET.Extensions;
using LyricsScraperNET.Helpers;
using LyricsScraperNET.Helpers;
using LyricsScraperNET.Models.Responses;
using LyricsScraperNET.Providers.Abstract;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -48,10 +47,10 @@ private MusixmatchClient GetMusixmatchClient()
//}
//else
//{
_logger.LogInformation("Use default MusixmatchToken.");
var musixmatchToken = new MusixmatchToken();
(Options as IExternalProviderOptionsWithApiKey).ApiKey = musixmatchToken.Token;
return new MusixmatchClient(musixmatchToken);
_logger.LogInformation("Use default MusixmatchToken.");
var musixmatchToken = new MusixmatchToken();
(Options as IExternalProviderOptionsWithApiKey).ApiKey = musixmatchToken.Token;
return new MusixmatchClient(musixmatchToken);
//}
}

Expand Down Expand Up @@ -86,8 +85,8 @@ protected override SearchResult SearchLyric(string artist, string song)
if (trackId != null)
{
Lyrics lyrics = client.GetTrackLyrics(trackId.Value);
return lyrics.Instrumental != 1
? new SearchResult(lyrics.LyricsBody, Models.ExternalProviderType.Musixmatch)
return lyrics.Instrumental != 1
? new SearchResult(lyrics.LyricsBody, Models.ExternalProviderType.Musixmatch)
: new SearchResult(); // lyrics.LyricsBody is null when the track is instrumental
}
else
Expand All @@ -114,7 +113,7 @@ protected override async Task<SearchResult> SearchLyricAsync(string artist, stri
var trackSearchParameters = GetTrackSearchParameters(artist, song);

var songSearchTask = await client.SongSearchAsync(trackSearchParameters);

var trackId = songSearchTask?.FirstOrDefault()?.TrackId;
if (trackId != null)
{
Expand Down

0 comments on commit 50b0bf5

Please sign in to comment.