Skip to content

Commit

Permalink
Merge pull request #35 from skuill/bugfix/33_genius_lyrics_cut_off
Browse files Browse the repository at this point in the history
Bugfix/33 genius lyrics cut off
  • Loading branch information
skuill authored Dec 13, 2024
2 parents 8d94e60 + 2d854c8 commit 6292ccf
Show file tree
Hide file tree
Showing 7 changed files with 879 additions and 649 deletions.
6 changes: 3 additions & 3 deletions LyricsScraperNET.Client/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"Enabled": true
},
"MusixmatchOptions": {
"SearchPriority": 1,
"SearchPriority": 0,
"Enabled": true,
"ApiKey": ""
},
"SongLyricsOptions": {
"SearchPriority": 0,
"SearchPriority": 2,
"Enabled": true
},
"LyricFindOptions": {
"SearchPriority": 2,
"SearchPriority": 1,
"Enabled": true
}
}
Expand Down
2 changes: 1 addition & 1 deletion LyricsScraperNET/Providers/Genius/GeniusProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public sealed class GeniusProvider : ExternalProviderBase
// Format: "artist song". Example: "Parkway Drive Carrion".
private const string GeniusSearchQueryFormat = "{0} {1}";

private const string _referentFragmentNodesXPath = "//a[contains(@class, 'ReferentFragmentVariantdesktop') or contains(@class, 'ReferentFragmentdesktop')]";
private const string _referentFragmentNodesXPath = "//a[contains(@class, 'ReferentFragmentVariantdesktop') or contains(@class, 'ReferentFragmentdesktop') or contains(@class, 'ReferentFragment-desktop')]";
private const string _lyricsContainerNodesXPath = "//div[@data-lyrics-container]";

// In case of instrumental song without a lyric.
Expand Down
2 changes: 1 addition & 1 deletion LyricsScraperNET/Providers/LyricFind/LyricFindOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public sealed class LyricFindOptions : IExternalProviderOptions

public ExternalProviderType ExternalProviderType => ExternalProviderType.LyricFind;

public int SearchPriority { get; set; } = 3;
public int SearchPriority { get; set; } = 1;

public const string ConfigurationSectionName = "LyricFindOptions";

Expand Down
2 changes: 1 addition & 1 deletion LyricsScraperNET/Providers/Musixmatch/MusixmatchOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed class MusixmatchOptions : IExternalProviderOptionsWithApiKey

public ExternalProviderType ExternalProviderType => ExternalProviderType.Musixmatch;

public int SearchPriority { get; set; } = 2;
public int SearchPriority { get; set; } = 0;

public override bool Equals(object? obj)
{
Expand Down
2 changes: 1 addition & 1 deletion LyricsScraperNET/Providers/SongLyrics/SongLyricsOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public sealed class SongLyricsOptions : IExternalProviderOptions

public ExternalProviderType ExternalProviderType => ExternalProviderType.SongLyrics;

public int SearchPriority { get; set; } = 0;
public int SearchPriority { get; set; } = 2;

public const string ConfigurationSectionName = "SongLyricsOptions";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void LyricsScraperClient_WithMusixmatch_ReturnsIsEnabled()
Assert.True(lyricsScraperClient.IsEnabled);
Assert.NotNull(externalTypeProvider);
Assert.True(externalTypeProvider.IsEnabled);
Assert.Equal(2, externalTypeProvider.SearchPriority);
Assert.Equal(0, externalTypeProvider.SearchPriority);
}

[Fact]
Expand All @@ -66,7 +66,7 @@ public void LyricsScraperClient_WithSongLyrics_ReturnsIsEnabled()
Assert.True(lyricsScraperClient.IsEnabled);
Assert.NotNull(externalTypeProvider);
Assert.True(externalTypeProvider.IsEnabled);
Assert.Equal(0, externalTypeProvider.SearchPriority);
Assert.Equal(2, externalTypeProvider.SearchPriority);
}

[Fact]
Expand All @@ -81,7 +81,7 @@ public void LyricsScraperClient_WithLyricFind_ReturnsIsEnabled()
Assert.True(lyricsScraperClient.IsEnabled);
Assert.NotNull(externalTypeProvider);
Assert.True(externalTypeProvider.IsEnabled);
Assert.Equal(3, externalTypeProvider.SearchPriority);
Assert.Equal(1, externalTypeProvider.SearchPriority);
}

[Fact]
Expand Down

Large diffs are not rendered by default.

0 comments on commit 6292ccf

Please sign in to comment.