Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Jay 2020-01-04 13:22:31 -08:00
commit e10caecc9a

View file

@ -229,7 +229,7 @@ class Downloader(
*/ */
fun queueChapters(manga: Manga, chapters: List<Chapter>, autoStart: Boolean) = launchUI { fun queueChapters(manga: Manga, chapters: List<Chapter>, autoStart: Boolean) = launchUI {
val source = sourceManager.get(manga.source) as? HttpSource ?: return@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. // Called in background thread, the operation can be slow with SAF.
val chaptersWithoutDir = async { val chaptersWithoutDir = async {
chapters chapters
@ -258,7 +258,7 @@ class Downloader(
} }
// Start downloader if needed // Start downloader if needed
if (autoStart) { if (autoStart && wasEmpty) {
DownloadService.start(this@Downloader.context) DownloadService.start(this@Downloader.context)
} }
} }