Cleaning up moved or deleted songs from Smart playlists i.e. History, Top played

This commit is contained in:
Prathamesh More 2021-11-29 19:31:41 +05:30
parent 2dcbe0801b
commit dcc04c6ea4
4 changed files with 37 additions and 1 deletions

View file

@ -26,6 +26,8 @@ interface HistoryDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertSongInHistory(historyEntity: HistoryEntity)
@Query("DELETE FROM HistoryEntity WHERE id= :songId")
fun deleteSongInHistory(songId: Long)
@Query("SELECT * FROM HistoryEntity WHERE id = :songId LIMIT 1")
suspend fun isSongPresentInHistory(songId: Long): HistoryEntity?