Skip to content

Commit

Permalink
Fix result scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Feb 12, 2021
1 parent 8b9052b commit c87e7a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion YouTube.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_best_fit_song_id(self, results, song):
if res['resultType'] == 'song' and res['album'] is not None:
scores.append(difflib.SequenceMatcher(a=res['album']['name'].lower(), b=song['album'].lower()).ratio())

match_score[res['videoId']] = sum(scores) / (len(scores) + 1) * max(1, int(res['resultType'] == 'song') * 1.5)
match_score[res['videoId']] = sum(scores) / len(scores) * max(1, int(res['resultType'] == 'song') * 1.5)

if len(match_score) == 0:
return None
Expand Down

0 comments on commit c87e7a2

Please sign in to comment.