bugfix: revise search_playlist to not rely on genre column within track_file_map (moved to separate db)
This commit is contained in:
parent
557310b0f0
commit
d1b96f7e64
@ -117,7 +117,7 @@ class RadioUtil:
|
||||
raise RadioException("No query provided")
|
||||
try:
|
||||
search_query: str = (
|
||||
'SELECT id, artist, song, (artist || " - " || song) AS artistsong, album, genre, file_path, duration FROM tracks\
|
||||
'SELECT id, artist, song, (artist || " - " || song) AS artistsong, album, file_path, duration FROM tracks\
|
||||
WHERE editdist3((lower(artist) || " " || lower(song)), (? || " " || ?))\
|
||||
<= 410 ORDER BY editdist3((lower(artist) || " " || lower(song)), ?) ASC LIMIT 1'
|
||||
)
|
||||
@ -148,10 +148,12 @@ class RadioUtil:
|
||||
push_obj: dict = {
|
||||
"id": result["id"],
|
||||
"uuid": str(uuid().hex),
|
||||
"artist": result["artist"].strip(),
|
||||
"song": result["song"].strip(),
|
||||
"artist": double_space.sub(" ", result["artist"].strip()),
|
||||
"song": double_space.sub(" ", result["song"].strip()),
|
||||
"artistsong": result["artistsong"].strip(),
|
||||
"genre": result["genre"],
|
||||
"genre": await self.get_genre(
|
||||
double_space.sub(" ", result["artist"].strip())
|
||||
),
|
||||
"file_path": result["file_path"],
|
||||
"duration": result["duration"],
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user