From aa57b1bc77ed010a780a42808ac4a1f0b473bd32 Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 3 Jan 2020 15:33:17 -0500 Subject: [PATCH] adjust so downloader doesnt autostart when queue was paused (#2413) adjust so downloader doesnt autostart when queue was paused --- .../main/java/eu/kanade/tachiyomi/data/download/Downloader.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt index 15ce3dc68..0dc8e1e6c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt @@ -199,7 +199,7 @@ class Downloader( */ fun queueChapters(manga: Manga, chapters: List, autoStart: Boolean) = launchUI { val source = sourceManager.get(manga.source) as? HttpSource ?: return@launchUI - + val wasEmpty = queue.isEmpty() // Called in background thread, the operation can be slow with SAF. val chaptersWithoutDir = async { val mangaDir = provider.findMangaDir(manga, source) @@ -232,7 +232,7 @@ class Downloader( } // Start downloader if needed - if (autoStart) { + if (autoStart && wasEmpty) { DownloadService.start(this@Downloader.context) } }