Lyrics: Use distance threshold for Genius search matches
Description
This PR introduces a distance threshold mechanism to the Genius backend and unifies its implementation across the rest of backends that perform searching and matching artists and titles.
- Create a new
SearchBackendbase class with a methodcheck_matchthat performs matching. - Start using undocumented
dist_threshconfiguration option for good, and mention it in the docs. This controls the maximum allowable distance for matching artist and title names.
These changes aim to improve the accuracy of lyrics matching, especially when there are slight variations in artist or title names.
Fixes #4791
To Do
- [x] Documentation. (If you've added a new command-line flag, for example, find the appropriate page under
docs/to describe it.) - [x] Changelog. (Add an entry to
docs/changelog.rstto the bottom of one of the lists near the top of the document.) - [x] Tests. (Very much encouraged but not strictly required.)
Have just discovered that it is not anymore possible to search lyrics on Tekstowo since search results are now shown within a Google container which is not parseable.
Going to move the last commit with tekstowo change to a separate PR and handle this issue there.
Superseded by #5474