Skip to content

Commit

Permalink
Merge pull request #1197 from Lurux/fix-search
Browse files Browse the repository at this point in the history
Fix local search only showing liked artists
  • Loading branch information
z-huang committed Jan 21, 2024
2 parents 58c4e44 + c83a81c commit ebf0a09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/com/zionhuang/music/db/DatabaseDao.kt
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ interface DatabaseDao {
fun searchSongs(query: String, previewSize: Int = Int.MAX_VALUE): Flow<List<Song>>

@Transaction
@Query("SELECT *, (SELECT COUNT(1) FROM song_artist_map JOIN song ON song_artist_map.songId = song.id WHERE artistId = artist.id AND song.inLibrary IS NOT NULL) AS songCount FROM artist WHERE name LIKE '%' || :query || '%' AND bookmarkedAt IS NOT NULL LIMIT :previewSize")
@Query("SELECT *, (SELECT COUNT(1) FROM song_artist_map JOIN song ON song_artist_map.songId = song.id WHERE artistId = artist.id AND song.inLibrary IS NOT NULL) AS songCount FROM artist WHERE name LIKE '%' || :query || '%' AND songCount > 0 LIMIT :previewSize")
fun searchArtists(query: String, previewSize: Int = Int.MAX_VALUE): Flow<List<Artist>>

@Transaction
Expand Down

0 comments on commit ebf0a09

Please sign in to comment.