Clean up fetch interval tests a bit
Also limit the dates we look at to most recent 10 distinct dates only. Closes #9930
This commit is contained in:
@@ -14,7 +14,7 @@ import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.isActive
|
||||
import tachiyomi.domain.chapter.model.Chapter
|
||||
import tachiyomi.domain.chapter.repository.ChapterRepository
|
||||
import tachiyomi.domain.manga.interactor.SetFetchInterval
|
||||
import tachiyomi.domain.manga.interactor.FetchInterval
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
import tachiyomi.domain.track.model.Track
|
||||
import uy.kohesive.injekt.Injekt
|
||||
@@ -31,10 +31,10 @@ class BackupRestorer(
|
||||
) {
|
||||
private val updateManga: UpdateManga = Injekt.get()
|
||||
private val chapterRepository: ChapterRepository = Injekt.get()
|
||||
private val setFetchInterval: SetFetchInterval = Injekt.get()
|
||||
private val fetchInterval: FetchInterval = Injekt.get()
|
||||
|
||||
private var now = ZonedDateTime.now()
|
||||
private var currentFetchWindow = setFetchInterval.getWindow(now)
|
||||
private var currentFetchWindow = fetchInterval.getWindow(now)
|
||||
|
||||
private var backupManager = BackupManager(context)
|
||||
|
||||
@@ -103,7 +103,7 @@ class BackupRestorer(
|
||||
val backupMaps = backup.backupBrokenSources.map { BackupSource(it.name, it.sourceId) } + backup.backupSources
|
||||
sourceMapping = backupMaps.associate { it.sourceId to it.name }
|
||||
now = ZonedDateTime.now()
|
||||
currentFetchWindow = setFetchInterval.getWindow(now)
|
||||
currentFetchWindow = fetchInterval.getWindow(now)
|
||||
|
||||
return coroutineScope {
|
||||
// Restore individual manga
|
||||
|
||||
Reference in New Issue
Block a user