imported more settings
This commit is contained in:
parent
922ccdfb27
commit
c242fedfee
21 changed files with 90 additions and 52 deletions
|
@ -9,6 +9,8 @@ import androidx.work.PeriodicWorkRequest
|
|||
import androidx.work.WorkManager
|
||||
import androidx.work.WorkerParameters
|
||||
import ani.dantotsu.loadData
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.settings.saving.PrefWrapper
|
||||
import ani.dantotsu.subcriptions.Subscription.Companion.defaultTime
|
||||
import ani.dantotsu.subcriptions.Subscription.Companion.timeMinutes
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
@ -29,7 +31,7 @@ class SubscriptionWorker(val context: Context, params: WorkerParameters) :
|
|||
|
||||
private const val SUBSCRIPTION_WORK_NAME = "work_subscription"
|
||||
fun enqueue(context: Context) {
|
||||
val curTime = loadData<Int>("subscriptions_time_s") ?: defaultTime
|
||||
val curTime = PrefWrapper.getVal(PrefName.SubscriptionsTimeS, defaultTime)
|
||||
if (timeMinutes[curTime] > 0L) {
|
||||
val constraints =
|
||||
Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue