From 7d67450e5800c90a6bb3f2d401b048e1acc5b0d0 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 13 Aug 2021 18:28:07 -0400 Subject: [PATCH] Always re-setup background jobs on migration runs --- .../java/eu/kanade/tachiyomi/Migrations.kt | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index afdcd30c8e..baf889d6ef 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -32,23 +32,20 @@ object Migrations { fun upgrade(preferences: PreferencesHelper): Boolean { val context = preferences.context - // Cancel app updater job for debug builds that don't include it - if (BuildConfig.DEBUG && !BuildConfig.INCLUDE_UPDATER) { - UpdaterJob.cancelTask(context) - } - val oldVersion = preferences.lastVersionCode().get() if (oldVersion < BuildConfig.VERSION_CODE) { preferences.lastVersionCode().set(BuildConfig.VERSION_CODE) + // Always set up background tasks to ensure they're running + if (BuildConfig.INCLUDE_UPDATER) { + UpdaterJob.setupTask(context) + } + ExtensionUpdateJob.setupTask(context) + LibraryUpdateJob.setupTask(context) + BackupCreatorJob.setupTask(context) + // Fresh install if (oldVersion == 0) { - // Set up default background tasks - if (BuildConfig.INCLUDE_UPDATER) { - UpdaterJob.setupTask(context) - } - ExtensionUpdateJob.setupTask(context) - LibraryUpdateJob.setupTask(context) return false } @@ -232,6 +229,7 @@ object Migrations { putString(PreferenceKeys.librarySortingDirection, newSortingDirection.name) } } + return true }