Skip to content

Commit

Permalink
fallback to title matching for non verified results when score is low…
Browse files Browse the repository at this point in the history
…er than 70
  • Loading branch information
xnetcat committed Nov 18, 2023
1 parent 553e7a8 commit 6643a33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spotdl/utils/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,13 @@ def artists_match_fixup1(song: Song, result: Result, score: float) -> float:
# If artist match is still too low,
# we fallback to matching all song artist names
# with the result's title
if score <= 50:
if score <= 70:
artist_title_match = 0.0
result_name = slugify(result.name).replace("-", "")
for artist in song.artists:
slug_artist = slugify(artist).replace("-", "")

if slug_artist in slugify(result.name).replace("-", ""):
if slug_artist in result_name:
artist_title_match += 1.0

artist_title_match = (artist_title_match / len(song.artists)) * 100
Expand Down

0 comments on commit 6643a33

Please sign in to comment.