better for fuzzy finder

This commit is contained in:
tavo-wasd 2024-03-31 11:44:05 -06:00
parent e20a21855c
commit 653ee7c3a1

View file

@ -22,7 +22,7 @@ def find_song(query, songs_dir):
song_path = os.path.join(root, file)
#song_name = os.path.relpath(song_path, start=songs_dir)
song_name = os.path.splitext(file)[0]
confidence = process.extractOne(query, [song_name])[1]
confidence = process.extractOne(query, [song_name.replace("_", " ")])[1]
if confidence > best_confidence:
best_match = song_path