adam-codersgu / supernova

A Kotlin-based Android application that allows the user to play music from their device while custom animations fall over the album artwork of the currently playing song.
0 stars 0 forks source link

Refine SQL queries #42

Closed adam-codersgu closed 1 year ago

adam-codersgu commented 1 year ago

In MusicDao.kt we have the following queries that should probably use = rather than LIKE. May also need to investigate PlaylistDao.kt

@Query("SELECT * from music_library WHERE song_album_id LIKE :albumID LIMIT 1") suspend fun getSongWithAlbumId(albumID: String): List

@Query("SELECT * FROM music_library WHERE song_album_id LIKE :albumID ORDER BY song_track ASC") fun findAlbumSongs(albumID: String): LiveData<List>

@Query("SELECT * FROM music_library WHERE song_artist LIKE :artistName ORDER BY song_title ASC") fun findArtistsSongs(artistName: String): LiveData<List>

adam-codersgu commented 1 year ago

Working on branch enhancement/sql_improvements

adam-codersgu commented 1 year ago

Merged and completed https://github.com/adam-codersgu/supernova/pull/47