Skip to content

Commit

Permalink
Order chapters to download by manga and source order (#697)
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 authored Oct 2, 2023
1 parent be26288 commit f985ed2
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,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 f985ed2

Please sign in to comment.