Manual-only new chapters check option
This commit is contained in:
@@ -245,10 +245,13 @@ class TrackWorker @AssistedInject constructor(
|
||||
) : PeriodicWorkScheduler {
|
||||
|
||||
override suspend fun schedule() {
|
||||
val frequency = settings.trackerFrequencyFactor
|
||||
if (frequency <= 0f) {
|
||||
return unschedule()
|
||||
}
|
||||
val constraints = createConstraints()
|
||||
val runCount = dbProvider.get().getTracksDao().getTracksCount()
|
||||
val runsPerFullCheck = (runCount / BATCH_SIZE.toFloat()).toIntUp().coerceAtLeast(1)
|
||||
val frequency = settings.trackerFrequencyFactor
|
||||
val interval = (18 / runsPerFullCheck / frequency).roundToInt().coerceAtLeast(2)
|
||||
val request = PeriodicWorkRequestBuilder<TrackWorker>(interval.toLong(), TimeUnit.HOURS)
|
||||
.setConstraints(constraints)
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
<item>@string/multiple_cbz_files</item>
|
||||
</string-array>
|
||||
<string-array name="tracker_frequency" translatable="false">
|
||||
<item>@string/manual</item>
|
||||
<item>@string/less_frequently</item>
|
||||
<item>@string/system_default</item>
|
||||
<item>@string/more_frequently</item>
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
<string-array name="values_tracker_frequency" translatable="false">
|
||||
<item>-1</item>
|
||||
<item>0.4</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
|
||||
Reference in New Issue
Block a user