Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 38: Add LyricsFreak Provider #45

Merged
merged 3 commits into from
Feb 2, 2025
Merged

Conversation

ajay201402
Copy link
Contributor

Changes done:
LyricsScraperNet project

  1. New implementation of Provider, Options, Parser & UriConverter classes for LyricsFreak.
  2. Changed Client Configuration and Service Collection extension to consider new provider.
  3. Added LyricsFreak to Model

LyricsScraperNet.Client Project

  1. appsettings json changed to configure LyricsFreak Provider.

Tests.

  1. Unit test added
  2. Integration tests added
  3. Test data and IWebClient mocking changes added

Copy link
Owner

@skuill skuill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your work on this PR! I've left a few comments with some suggestions for improvements in the code.

Additionally, I tested a complex case with the following URL: Attack Attack - I Swear I'll Change, and encountered an error. Please have a look into this issue to ensure proper handling of such cases.
Error is:
image
I tried the following fields in search request:

            string artistToSearch = "Attack Attack!";
            string songToSearch = "I Swear I'll Change";

Also, in the Readme.md, I suggest replacing, if you don't mind:
LyricsFreak (Coming soon 🚧. Issue #38)

with: LyricsFreak (added by @ajay201402)

@@ -0,0 +1,150 @@
using Genius.Models.Song;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pleasse sort and remove unused usings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


if (WebClient == null || Parser == null)
{
_logger?.LogWarning($"LyricFind. Please set up WebClient and Parser first");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a copy-paste issue in the log messages. For instance, "LyricFind" appears incorrectly here and in other places in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


namespace LyricsScraperNET.Providers.LyricsFreak
{
internal sealed class LyricsFreakUriConverter : IExternalUriConverter
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plaese Add Unit Tests for LyricsFreakUriConverter similar to other converters. You can refer to test cases in AZLyricsUriConverterTests. Ensure that the information is correctly fetched from the specified address when writing the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -39,6 +40,12 @@ public static ILyricsScraperClient WithLyricFind(this ILyricsScraperClient lyric
return lyricsScraperClient;
}

public static ILyricsScraperClient WithLyricsFreak(this ILyricsScraperClient lyricsScraperClient)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test in the LyricsScraperClientExtensionsTest like: LyricsScraperClient_WithLyricsFreak_ReturnsIsEnabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -71,5 +71,25 @@ public static string СonvertToDashedFormat(this string input, bool useException

return result;
}

public static string СonvertSpaceToPlusFormat(this string input, bool removeProhibitedSymbols = false)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a couple unit tests in the:
StringExtensionsTest
Take a look at the ases in: СonvertToDashedFormat_MultipleInputs_ShouldBeParse

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@skuill skuill linked an issue Jan 9, 2025 that may be closed by this pull request
@skuill skuill added enhancement New feature or request good first issue Good for newcomers labels Jan 9, 2025
@ajay201402
Copy link
Contributor Author

Hi @skuill I will take this up and reply soon. Thanks for the comments

@ajay201402
Copy link
Contributor Author

@skuill All the review comments are fixed. Please check

@skuill skuill changed the title Issue 38: Initial commit for Lyrics Freak Provider Issue 38: Addd LyricsFreak Provider Feb 2, 2025
@skuill skuill changed the title Issue 38: Addd LyricsFreak Provider Issue 38: Add LyricsFreak Provider Feb 2, 2025
@skuill
Copy link
Owner

skuill commented Feb 2, 2025

Hi @ajay201402 !

Thank you for your PR and contribution and fixing all the PR comments!

I'll merge your PR and do a final review of the package before publishing it. I'll let you know when the package is published.

@skuill skuill merged commit 0071bc4 into skuill:main Feb 2, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add LyricsFreak provider
2 participants