diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt index 425644682..5a907ccbb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt @@ -111,11 +111,14 @@ class DownloadManager(private val context: Context, private val sourceManager: S fun downloadChapters(manga: Manga, chapters: List) { val source = sourceManager.get(manga.source) as? OnlineSource ?: return + // Add chapters to queue from the start + val sortedChapters = chapters.sortedByDescending { it.source_order } + // Used to avoid downloading chapters with the same name val addedChapters = ArrayList() val pending = ArrayList() - for (chapter in chapters) { + for (chapter in sortedChapters) { if (addedChapters.contains(chapter.name)) continue