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")
|
raise RadioException("No query provided")
|
||||||
try:
|
try:
|
||||||
search_query: str = (
|
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)), (? || " " || ?))\
|
WHERE editdist3((lower(artist) || " " || lower(song)), (? || " " || ?))\
|
||||||
<= 410 ORDER BY editdist3((lower(artist) || " " || lower(song)), ?) ASC LIMIT 1'
|
<= 410 ORDER BY editdist3((lower(artist) || " " || lower(song)), ?) ASC LIMIT 1'
|
||||||
)
|
)
|
||||||
@ -148,10 +148,12 @@ class RadioUtil:
|
|||||||
push_obj: dict = {
|
push_obj: dict = {
|
||||||
"id": result["id"],
|
"id": result["id"],
|
||||||
"uuid": str(uuid().hex),
|
"uuid": str(uuid().hex),
|
||||||
"artist": result["artist"].strip(),
|
"artist": double_space.sub(" ", result["artist"].strip()),
|
||||||
"song": result["song"].strip(),
|
"song": double_space.sub(" ", result["song"].strip()),
|
||||||
"artistsong": result["artistsong"].strip(),
|
"artistsong": result["artistsong"].strip(),
|
||||||
"genre": result["genre"],
|
"genre": await self.get_genre(
|
||||||
|
double_space.sub(" ", result["artist"].strip())
|
||||||
|
),
|
||||||
"file_path": result["file_path"],
|
"file_path": result["file_path"],
|
||||||
"duration": result["duration"],
|
"duration": result["duration"],
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user