feat: add read last read chapter shortcut (#7230)

Supersedes #6861

Co-authored-by: Pierre-Monier <65488471+Pierre-Monier@users.noreply.github.com>

Co-authored-by: Pierre-Monier <65488471+Pierre-Monier@users.noreply.github.com>
This commit is contained in:
Andreas
2022-06-01 04:55:58 +02:00
committed by GitHub
parent 11c61d42dc
commit 4560033e66
9 changed files with 61 additions and 9 deletions

View File

@@ -26,7 +26,13 @@ class HistoryRepositoryImpl(
)
}
override suspend fun getNextChapterForManga(mangaId: Long, chapterId: Long): Chapter? {
override suspend fun getLastHistory(): HistoryWithRelations? {
return handler.awaitOneOrNull {
historyViewQueries.getLatestHistory(historyWithRelationsMapper)
}
}
override suspend fun getNextChapter(mangaId: Long, chapterId: Long): Chapter? {
val chapter = handler.awaitOne { chaptersQueries.getChapterById(chapterId, chapterMapper) }
val manga = handler.awaitOne { mangasQueries.getMangaById(mangaId, mangaMapper) }