Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ constructor(
val newHistory = makeNewHistory(oldDetails, newDetails, oldHistory)
historyDao.delete(oldDetails.id)
historyDao.upsert(newHistory)
database.getStatsDao().move(oldDetails.id, newDetails.id)
newHistory
} else {
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ abstract class StatsDao {
@Query("SELECT COUNT(*) FROM stats WHERE manga_id = :mangaId")
abstract fun observeRowCount(mangaId: Long): Flow<Int>

@Query("UPDATE OR IGNORE stats SET manga_id = :newMangaId WHERE manga_id = :oldMangaId")
abstract suspend fun move(oldMangaId: Long, newMangaId: Long)

@Upsert
abstract suspend fun upsert(entity: StatsEntity)

Expand Down
Loading