better for fuzzy finder
This commit is contained in:
parent
e20a21855c
commit
653ee7c3a1
1 changed files with 1 additions and 1 deletions
2
main.py
2
main.py
|
@ -22,7 +22,7 @@ def find_song(query, songs_dir):
|
||||||
song_path = os.path.join(root, file)
|
song_path = os.path.join(root, file)
|
||||||
#song_name = os.path.relpath(song_path, start=songs_dir)
|
#song_name = os.path.relpath(song_path, start=songs_dir)
|
||||||
song_name = os.path.splitext(file)[0]
|
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:
|
if confidence > best_confidence:
|
||||||
best_match = song_path
|
best_match = song_path
|
||||||
|
|
Loading…
Reference in a new issue