Order chapters to download by manga and source order (#697)

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.
This commit is contained in:
schroda
2023-10-02 23:46:38 +02:00
committed by GitHub
parent be2628875f
commit f985ed2131

View File

@@ -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()
}