Skip to content

Commit

Permalink
Order chapters to download by manga and source order
Browse files Browse the repository at this point in the history
Chapters were added to the queue by database index order.
In case a chapters of different mangas got added to the queue, downloads got mingled instead of being group inserted per manga.
Also sort manga chapters by source order, to make sure, that, in case chapters of a manga are, for some reason, not in the correct order in the database, they will still get downloaded in the order of the source.
  • Loading branch information
schroda committed Sep 18, 2023
1 parent ce42193 commit 8b088cf
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ object DownloadManager {
val chapters = transaction {
(ChapterTable innerJoin MangaTable)
.select { ChapterTable.id inList input.chapterIds }
.orderBy(ChapterTable.manga)
.orderBy(ChapterTable.sourceOrder)
.toList()
}

Expand Down

0 comments on commit 8b088cf

Please sign in to comment.