소스 검색

[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
Quang Kieu 1 년 전
부모
커밋
d874f20362
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt

+ 2 - 3
app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt

@@ -230,8 +230,7 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
         val failedUpdates = CopyOnWriteArrayList<Pair<Manga, String?>>()
         val hasDownloads = AtomicBoolean(false)
         val restrictions = libraryPreferences.libraryUpdateMangaRestriction().get()
-
-        val fetchWindow by lazy { setFetchInterval.getWindow(ZonedDateTime.now()) }
+        val fetchWindow = setFetchInterval.getWindow(ZonedDateTime.now())
 
         coroutineScope {
             mangaToUpdate.groupBy { it.manga.source }.values
@@ -265,7 +264,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 -> {