Add throttling when restoring E-Hentai/ExHentai galleries.

This commit is contained in:
NerdNumber9
2019-04-19 22:59:24 -04:00
parent 6ada3cbf59
commit 39e0d434ad
6 changed files with 76 additions and 37 deletions

View File

@ -176,7 +176,12 @@ class GalleryAdder {
//Fetch and copy chapters
try {
sourceObj.fetchChapterList(manga).map {
val chapterListObs = if(sourceObj is EHentai) {
sourceObj.fetchChapterList(manga, throttleFunc)
} else {
sourceObj.fetchChapterList(manga)
}
chapterListObs.map {
syncChaptersWithSource(db, it, manga, sourceObj)
}.toBlocking().first()
} catch (e: Exception) {