Fix FTS search query alias usage

This commit is contained in:
Jordan Wages 2025-09-18 22:22:57 -05:00
commit 8111d8985e

View file

@ -881,7 +881,7 @@
JOIN tracks t ON t.id = f.rowid
JOIN artists a ON a.id = t.artist_id
LEFT JOIN albums al ON al.id = t.album_id
WHERE f MATCH ?
WHERE fts_tracks MATCH ?
ORDER BY rank
LIMIT ? OFFSET ?
`,
@ -891,7 +891,7 @@
JOIN tracks t ON t.id = f.rowid
JOIN artists a ON a.id = t.artist_id
LEFT JOIN albums al ON al.id = t.album_id
WHERE f MATCH ?
WHERE fts_tracks MATCH ?
ORDER BY a.name COLLATE NOCASE, t.title COLLATE NOCASE, COALESCE(t.year, 0)
LIMIT ? OFFSET ?
`,
@ -902,7 +902,7 @@
JOIN tracks t ON t.id = f.rowid
JOIN artists a ON a.id = t.artist_id
LEFT JOIN albums al ON al.id = t.album_id
WHERE f MATCH ?
WHERE fts_tracks MATCH ?
`;
function enableSearch() {
@ -1105,7 +1105,7 @@
FROM fts_tracks f
JOIN tracks t ON t.id = f.rowid
JOIN artists a ON a.id = t.artist_id
WHERE f MATCH ?
WHERE fts_tracks MATCH ?
GROUP BY a.id
) AS matches
`;
@ -1114,7 +1114,7 @@
FROM fts_tracks f
JOIN tracks t ON t.id = f.rowid
JOIN artists a ON a.id = t.artist_id
WHERE f MATCH ?
WHERE fts_tracks MATCH ?
GROUP BY a.id
ORDER BY a.name COLLATE NOCASE
LIMIT ? OFFSET ?