mirror of
https://github.com/InsanusMokrassar/SauceNaoAPI.git
synced 2025-09-16 13:39:18 +00:00
update publishing
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
package dev.inmo.saucenaoapi.utils
|
||||
|
||||
import dev.inmo.saucenaoapi.additional.LONG_TIME_RECALCULATING_MILLIS
|
||||
import dev.inmo.saucenaoapi.additional.SHORT_TIME_RECALCULATING_MILLIS
|
||||
import dev.inmo.saucenaoapi.models.Header
|
||||
import com.soywiz.klock.DateTime
|
||||
|
||||
internal suspend fun calculateSleepTime(
|
||||
header: Header,
|
||||
mostOldestInShortPeriodGetter: suspend () -> DateTime?,
|
||||
mostOldestInLongPeriodGetter: suspend () -> DateTime?
|
||||
): DateTime? {
|
||||
return when {
|
||||
header.longRemaining < 1 -> mostOldestInLongPeriodGetter() ?.plus(LONG_TIME_RECALCULATING_MILLIS)
|
||||
header.shortRemaining < 1 -> mostOldestInShortPeriodGetter() ?.plus(SHORT_TIME_RECALCULATING_MILLIS)
|
||||
else -> null
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user