From 9c6c60b42dc08fbbf815e1617cdb52436c35acdf Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 8 Jun 2023 19:25:16 +0200 Subject: [PATCH] Make watch history and positions deletion function suspend --- .../main/java/com/github/libretube/db/dao/WatchHistoryDao.kt | 2 +- .../main/java/com/github/libretube/db/dao/WatchPositionDao.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/libretube/db/dao/WatchHistoryDao.kt b/app/src/main/java/com/github/libretube/db/dao/WatchHistoryDao.kt index 4cbf90b5e..9db6be007 100644 --- a/app/src/main/java/com/github/libretube/db/dao/WatchHistoryDao.kt +++ b/app/src/main/java/com/github/libretube/db/dao/WatchHistoryDao.kt @@ -26,7 +26,7 @@ interface WatchHistoryDao { suspend fun delete(watchHistoryItem: WatchHistoryItem) @Query("DELETE FROM watchHistoryItem WHERE videoId = :id") - fun deleteByVideoId(id: String) + suspend fun deleteByVideoId(id: String) @Query("DELETE FROM watchHistoryItem") suspend fun deleteAll() diff --git a/app/src/main/java/com/github/libretube/db/dao/WatchPositionDao.kt b/app/src/main/java/com/github/libretube/db/dao/WatchPositionDao.kt index 9cbf800e5..6fc40aa43 100644 --- a/app/src/main/java/com/github/libretube/db/dao/WatchPositionDao.kt +++ b/app/src/main/java/com/github/libretube/db/dao/WatchPositionDao.kt @@ -21,7 +21,7 @@ interface WatchPositionDao { suspend fun insertAll(watchPositions: List) @Query("DELETE FROM watchPosition WHERE videoId = :id") - fun deleteByVideoId(id: String) + suspend fun deleteByVideoId(id: String) @Query("DELETE FROM watchPosition") suspend fun deleteAll()