From 724e1d33b640d2fea8305986fc8266a67bb0acc5 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 13 Mar 2020 17:29:51 -0400 Subject: [PATCH] Ensure background jobs are recreated after next stable update --- app/src/main/java/eu/kanade/tachiyomi/Migrations.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index 6f7ab89570..ad664d8074 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi +import eu.kanade.tachiyomi.data.backup.BackupCreatorJob import eu.kanade.tachiyomi.data.library.LibraryUpdateJob import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault @@ -62,6 +63,14 @@ object Migrations { } } } + if (oldVersion < 43) { + // Restore jobs after migrating from Evernote's job scheduler to WorkManager. + if (BuildConfig.INCLUDE_UPDATER && preferences.automaticUpdates()) { + UpdaterJob.setupTask(context) + } + LibraryUpdateJob.setupTask(context) + BackupCreatorJob.setupTask(context) + } return true } return false