themes and various bugs
This commit is contained in:
parent
dc165fa6bc
commit
63526c6ed3
114 changed files with 1719 additions and 558 deletions
|
@ -40,7 +40,7 @@ class AlarmReceiver : BroadcastReceiver() {
|
|||
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||
val curTime = loadData<Int>("subscriptions_time", context) ?: defaultTime
|
||||
val curTime = loadData<Int>("subscriptions_time_r", context) ?: defaultTime
|
||||
|
||||
if (timeMinutes[curTime] > 0)
|
||||
alarmManager.setRepeating(
|
||||
|
|
|
@ -16,8 +16,8 @@ import kotlinx.coroutines.launch
|
|||
@SuppressLint("MissingPermission")
|
||||
class Subscription {
|
||||
companion object {
|
||||
const val defaultTime = 8
|
||||
val timeMinutes = arrayOf(0L, 5, 10, 15, 30, 45, 60, 90, 120, 180, 240, 360, 480, 720, 1440)
|
||||
const val defaultTime = 3
|
||||
val timeMinutes = arrayOf(0L, 120, 180, 240, 360, 480, 720, 1440)
|
||||
|
||||
private var alreadyStarted = false
|
||||
fun Context.startSubscription(force: Boolean = false) {
|
||||
|
|
|
@ -9,6 +9,7 @@ import ani.dantotsu.parsers.*
|
|||
import ani.dantotsu.saveData
|
||||
import ani.dantotsu.tryWithSuspend
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.media.manga.MangaNameAdapter
|
||||
import kotlinx.coroutines.withTimeoutOrNull
|
||||
|
||||
class SubscriptionHelper {
|
||||
|
@ -76,7 +77,7 @@ class SubscriptionHelper {
|
|||
}
|
||||
|
||||
return chp?.apply {
|
||||
selected.latest = number.toFloat()
|
||||
selected.latest = MangaNameAdapter.findChapterNumber(number) ?: 0f
|
||||
saveSelected(context, id, selected)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class SubscriptionWorker(val context: Context, params: WorkerParameters) : Corou
|
|||
|
||||
private const val SUBSCRIPTION_WORK_NAME = "work_subscription"
|
||||
fun enqueue(context: Context) {
|
||||
val curTime = loadData<Int>("subscriptions_time") ?: defaultTime
|
||||
val curTime = loadData<Int>("subscriptions_time_r") ?: defaultTime
|
||||
if(timeMinutes[curTime]>0L) {
|
||||
val constraints = Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build()
|
||||
val periodicSyncDataWork = PeriodicWorkRequest.Builder(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue