Restyle Implement Fuzzy search using rapidfuzz (#60)

This commit is contained in:
restyled-io[bot]
2022-05-26 19:12:04 +03:00
committed by GitHub
parent 1a3a196d7a
commit 2b33fb87a2
15 changed files with 90 additions and 74 deletions
+4 -6
View File
@@ -6,8 +6,8 @@ from dataclasses import field
from typing import List
from app import api
from app.exceptions import TrackExistsInPlaylist
from app import helpers
from app.exceptions import TrackExistsInPlaylist
@dataclass(slots=True)
@@ -97,11 +97,9 @@ class Album:
def get_p_track(ptrack):
for track in api.TRACKS:
if (
track.title == ptrack["title"]
and track.artists == ptrack["artists"]
and ptrack["album"] == track.album
):
if (track.title == ptrack["title"]
and track.artists == ptrack["artists"]
and ptrack["album"] == track.album):
return track