Remove unnecessary "downloadNewChapters" call in "fetchChapters" mutation (#652)

Gets already called by "Chapter::fetchChapterList", thus, this is unnecessary.
Additionally, "chapters.toList()" and "chapters.map()" have to be called in a transaction block, which they are not, and thus, cause an unhandled exception, breaking the mutation
This commit is contained in:
schroda
2023-08-12 17:15:06 +02:00
committed by GitHub
parent 557bad60bc
commit 01ab912bd9
2 changed files with 4 additions and 8 deletions

View File

@@ -201,7 +201,7 @@ object Chapter {
return chapterList
}
fun downloadNewChapters(mangaId: Int, prevNumberOfChapters: Int, newChapters: List<ResultRow>) {
private fun downloadNewChapters(mangaId: Int, prevNumberOfChapters: Int, newChapters: List<ResultRow>) {
// convert numbers to be index based
val currentNumberOfChapters = (prevNumberOfChapters - 1).coerceAtLeast(0)
val updatedNumberOfChapters = (newChapters.size - 1).coerceAtLeast(0)