mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-26 23:18:17 +03:00
Downloading chapters now always add them from the beginning
This commit is contained in:
parent
9aa6da0642
commit
46cc078e93
1 changed files with 4 additions and 1 deletions
|
@ -111,11 +111,14 @@ class DownloadManager(private val context: Context, private val sourceManager: S
|
|||
fun downloadChapters(manga: Manga, chapters: List<Chapter>) {
|
||||
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<String>()
|
||||
val pending = ArrayList<Download>()
|
||||
|
||||
for (chapter in chapters) {
|
||||
for (chapter in sortedChapters) {
|
||||
if (addedChapters.contains(chapter.name))
|
||||
continue
|
||||
|
||||
|
|
Loading…
Reference in a new issue