mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-29 03:41:02 +00:00
feat: move subscriptions to new notification method
This commit is contained in:
@@ -7,12 +7,10 @@ import ani.dantotsu.util.Logger
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
class CommentNotificationReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
override fun onReceive(context: Context, intent: Intent?) {
|
||||
Logger.log("CommentNotificationReceiver: onReceive")
|
||||
if (context != null) {
|
||||
runBlocking {
|
||||
CommentNotificationTask().execute(context)
|
||||
}
|
||||
runBlocking {
|
||||
CommentNotificationTask().execute(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ class CommentNotificationWorker(appContext: Context, workerParams: WorkerParamet
|
||||
return if (CommentNotificationTask().execute(applicationContext)) {
|
||||
Result.success()
|
||||
} else {
|
||||
Logger.log("CommentNotificationWorker: doWork failed")
|
||||
Result.retry()
|
||||
}
|
||||
}
|
||||
@@ -27,7 +28,7 @@ class CommentNotificationWorker(appContext: Context, workerParams: WorkerParamet
|
||||
}
|
||||
|
||||
companion object {
|
||||
val checkIntervals = arrayOf(0L, 720, 1440)
|
||||
val checkIntervals = arrayOf(0L, 480, 720, 1440)
|
||||
const val WORK_NAME = "ani.dantotsu.notifications.comment.CommentNotificationWorker"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user