diff --git a/app/src/main/java/com/dd3boh/outertune/db/DatabaseDao.kt b/app/src/main/java/com/dd3boh/outertune/db/DatabaseDao.kt index c16e14218..72188fd46 100644 --- a/app/src/main/java/com/dd3boh/outertune/db/DatabaseDao.kt +++ b/app/src/main/java/com/dd3boh/outertune/db/DatabaseDao.kt @@ -134,11 +134,11 @@ interface DatabaseDao { fun likedSongsByCreateDateAsc(): Flow> @Transaction - @Query("SELECT * FROM song WHERE liked IS NOT NULL ORDER BY date") + @Query("SELECT * FROM song WHERE liked ORDER BY date") fun likedSongsByReleaseDateAsc(): Flow> @Transaction - @Query("SELECT * FROM song WHERE liked IS NOT NULL ORDER BY dateModified") + @Query("SELECT * FROM song WHERE liked ORDER BY dateModified") fun likedSongsByDateModifiedAsc(): Flow> @Transaction @@ -164,9 +164,9 @@ interface DatabaseDao { fun likedSongs(sortType: SongSortType, descending: Boolean) = when (sortType) { SongSortType.CREATE_DATE -> likedSongsByCreateDateAsc() - SongSortType.MODIFIED_DATE -> songsByDateModifiedAsc() + SongSortType.MODIFIED_DATE -> likedSongsByDateModifiedAsc() SongSortType.RELEASE_DATE -> { - val songs = songsByReleaseDateAsc() + val songs = likedSongsByReleaseDateAsc() runBlocking { flowOf(songs.first().sortedBy { it.song.getDateLong()