Adjust update/download warning threshold
This commit is contained in:
parent
f0f3afd5f1
commit
b17b882a3b
2 changed files with 7 additions and 4 deletions
|
@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.data.database.models.Chapter
|
||||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||||
import eu.kanade.tachiyomi.data.download.model.Download
|
import eu.kanade.tachiyomi.data.download.model.Download
|
||||||
import eu.kanade.tachiyomi.data.download.model.DownloadQueue
|
import eu.kanade.tachiyomi.data.download.model.DownloadQueue
|
||||||
import eu.kanade.tachiyomi.data.library.QUEUE_SIZE_WARNING_THRESHOLD
|
import eu.kanade.tachiyomi.data.library.PER_SOURCE_QUEUE_WARNING_THRESHOLD
|
||||||
import eu.kanade.tachiyomi.source.SourceManager
|
import eu.kanade.tachiyomi.source.SourceManager
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
import eu.kanade.tachiyomi.source.model.Page
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||||
|
@ -264,7 +264,8 @@ class Downloader(
|
||||||
|
|
||||||
// Start downloader if needed
|
// Start downloader if needed
|
||||||
if (autoStart && wasEmpty) {
|
if (autoStart && wasEmpty) {
|
||||||
if (queue.size > QUEUE_SIZE_WARNING_THRESHOLD) {
|
val maxDownloadsFromSource = queue.groupBy { it.source }.maxOf { it.value.size }
|
||||||
|
if (maxDownloadsFromSource > PER_SOURCE_QUEUE_WARNING_THRESHOLD) {
|
||||||
notifier.onWarning(context.getString(R.string.notification_size_warning))
|
notifier.onWarning(context.getString(R.string.notification_size_warning))
|
||||||
}
|
}
|
||||||
DownloadService.start(context)
|
DownloadService.start(context)
|
||||||
|
|
|
@ -265,7 +265,9 @@ class LibraryUpdateService(
|
||||||
.distinctBy { it.id }
|
.distinctBy { it.id }
|
||||||
.sortedWith(rankingScheme[selectedScheme])
|
.sortedWith(rankingScheme[selectedScheme])
|
||||||
|
|
||||||
if (mangaToUpdate.size > QUEUE_SIZE_WARNING_THRESHOLD) {
|
// Warn when excessively checking a single source
|
||||||
|
val maxUpdatesFromSource = mangaToUpdate.groupBy { it.source }.maxOf { it.value.size }
|
||||||
|
if (maxUpdatesFromSource > PER_SOURCE_QUEUE_WARNING_THRESHOLD) {
|
||||||
notifier.showQueueSizeWarningNotification()
|
notifier.showQueueSizeWarningNotification()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -572,4 +574,4 @@ class LibraryUpdateService(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const val QUEUE_SIZE_WARNING_THRESHOLD = 100
|
const val PER_SOURCE_QUEUE_WARNING_THRESHOLD = 50
|
||||||
|
|
Reference in a new issue