[Hotfix] Fix bug of not fetch update if manual library refresh as fetch period have lower limit (#9806)

Fix bug of not fetch update if manual library refresh, no auto

If somehow manga missed check period, we would not give new next update cycle and it would forever left behind

(cherry picked from commit d874f20362217bf1752b16f513143f1f83972f69)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt
This commit is contained in:
Quang Kieu 2023-08-05 09:07:00 -04:00 committed by Jobobby04
parent c20ea36f50
commit 9e7748c84b

View File

@ -307,7 +307,7 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
val mdlistLogged = trackManager.services.any { it.isLogged && it.id == TrackManager.MDLIST }
// SY <--
val fetchWindow by lazy { setFetchInterval.getWindow(ZonedDateTime.now()) }
val fetchWindow = setFetchInterval.getWindow(ZonedDateTime.now())
coroutineScope {
mangaToUpdate.groupBy { it.manga.source }
@ -361,7 +361,7 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
MANGA_NON_READ in restrictions && libraryManga.totalChapters > 0L && !libraryManga.hasStarted ->
skippedUpdates.add(manga to context.getString(R.string.skipped_reason_not_started))
MANGA_OUTSIDE_RELEASE_PERIOD in restrictions && manga.nextUpdate !in fetchWindow.first.rangeTo(fetchWindow.second) ->
MANGA_OUTSIDE_RELEASE_PERIOD in restrictions && manga.nextUpdate > fetchWindow.second ->
skippedUpdates.add(manga to context.getString(R.string.skipped_reason_not_in_release_period))
else -> {