Added clear history function to repositories
This commit is contained in:
parent
4562afd544
commit
ddf801f9f3
2 changed files with 10 additions and 0 deletions
|
@ -100,6 +100,7 @@ interface Repository {
|
|||
suspend fun updateSongInPlayCount(playCountEntity: PlayCountEntity)
|
||||
suspend fun deleteSongInPlayCount(playCountEntity: PlayCountEntity)
|
||||
suspend fun deleteSongInHistory(songId: Long)
|
||||
suspend fun clearSongHistory()
|
||||
suspend fun checkSongExistInPlayCount(songId: Long): List<PlayCountEntity>
|
||||
suspend fun playCountSongs(): List<PlayCountEntity>
|
||||
suspend fun blackListPaths(): List<BlackListStoreEntity>
|
||||
|
@ -330,6 +331,10 @@ class RealRepository(
|
|||
override suspend fun deleteSongInHistory(songId: Long) =
|
||||
roomRepository.deleteSongInHistory(songId)
|
||||
|
||||
override suspend fun clearSongHistory() {
|
||||
roomRepository.clearSongHistory()
|
||||
}
|
||||
|
||||
override suspend fun checkSongExistInPlayCount(songId: Long): List<PlayCountEntity> =
|
||||
roomRepository.checkSongExistInPlayCount(songId)
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ interface RoomRepository {
|
|||
suspend fun updateSongInPlayCount(playCountEntity: PlayCountEntity)
|
||||
suspend fun deleteSongInPlayCount(playCountEntity: PlayCountEntity)
|
||||
suspend fun deleteSongInHistory(songId: Long)
|
||||
suspend fun clearSongHistory()
|
||||
suspend fun checkSongExistInPlayCount(songId: Long): List<PlayCountEntity>
|
||||
suspend fun playCountSongs(): List<PlayCountEntity>
|
||||
suspend fun insertBlacklistPath(blackListStoreEntities: List<BlackListStoreEntity>)
|
||||
|
@ -170,6 +171,10 @@ class RealRoomRepository(
|
|||
historyDao.deleteSongInHistory(songId)
|
||||
}
|
||||
|
||||
override suspend fun clearSongHistory() {
|
||||
historyDao.clearHistory()
|
||||
}
|
||||
|
||||
override suspend fun checkSongExistInPlayCount(songId: Long): List<PlayCountEntity> =
|
||||
playCountDao.checkSongExistInPlayCount(songId)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue