mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 20:01:50 +01:00
Start downloader after a library update. It should help with some catalogue issues
This commit is contained in:
parent
182bf5f2bd
commit
34a40b0131
@ -85,9 +85,10 @@ class DownloadManager(context: Context) {
|
||||
*
|
||||
* @param manga the manga of the chapters.
|
||||
* @param chapters the list of chapters to enqueue.
|
||||
* @param autoStart whether to start the downloader after enqueing the chapters.
|
||||
*/
|
||||
fun downloadChapters(manga: Manga, chapters: List<Chapter>) {
|
||||
downloader.queueChapters(manga, chapters)
|
||||
fun downloadChapters(manga: Manga, chapters: List<Chapter>, autoStart: Boolean = true) {
|
||||
downloader.queueChapters(manga, chapters, autoStart)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -219,8 +219,9 @@ class Downloader(private val context: Context,
|
||||
*
|
||||
* @param manga the manga of the chapters to download.
|
||||
* @param chapters the list of chapters to download.
|
||||
* @param autoStart whether to start the downloader after enqueing the chapters.
|
||||
*/
|
||||
fun queueChapters(manga: Manga, chapters: List<Chapter>) = launchUI {
|
||||
fun queueChapters(manga: Manga, chapters: List<Chapter>, autoStart: Boolean) = launchUI {
|
||||
val source = sourceManager.get(manga.source) as? HttpSource ?: return@launchUI
|
||||
|
||||
// Called in background thread, the operation can be slow with SAF.
|
||||
@ -261,7 +262,9 @@ class Downloader(private val context: Context,
|
||||
}
|
||||
|
||||
// Start downloader if needed
|
||||
DownloadService.start(this@Downloader.context)
|
||||
if (autoStart) {
|
||||
DownloadService.start(this@Downloader.context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -333,7 +333,9 @@ class LibraryUpdateService(
|
||||
val dbChapters = chapters.map {
|
||||
mangaChapters.find { mangaChapter -> mangaChapter.url == it.url }!!
|
||||
}
|
||||
downloadManager.downloadChapters(manga, dbChapters)
|
||||
// We don't want to start downloading while the library is updating, because websites
|
||||
// may don't like it and they could ban the user.
|
||||
downloadManager.downloadChapters(manga, dbChapters, false)
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user