Fix some migrations never running (mihonapp/mihon#1114)
Both `SetupBackupCreateMigration` and `SetupLibraryUpdateMigration` were trying to get the `App` class from Injekt which is never provided via the `AppModule`. Using `Application` instead works since the `workManager` property used by the respective `setupTask` functions is an extension property on `Context`. Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com> (cherry picked from commit be124ebe86377ad77de5abd1594afd7aedf9050c)
This commit is contained in:
parent
39f3dc970c
commit
34ef197aeb
2 changed files with 4 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
package mihon.core.migration.migrations
|
||||
|
||||
import eu.kanade.tachiyomi.App
|
||||
import android.app.Application
|
||||
import eu.kanade.tachiyomi.data.backup.create.BackupCreateJob
|
||||
import mihon.core.migration.Migration
|
||||
import mihon.core.migration.MigrationContext
|
||||
|
|
@ -9,7 +9,7 @@ class SetupBackupCreateMigration : Migration {
|
|||
override val version: Float = Migration.ALWAYS
|
||||
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context = migrationContext.get<App>() ?: return false
|
||||
val context = migrationContext.get<Application>() ?: return false
|
||||
BackupCreateJob.setupTask(context)
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package mihon.core.migration.migrations
|
||||
|
||||
import eu.kanade.tachiyomi.App
|
||||
import android.app.Application
|
||||
import eu.kanade.tachiyomi.data.library.LibraryUpdateJob
|
||||
import mihon.core.migration.Migration
|
||||
import mihon.core.migration.MigrationContext
|
||||
|
|
@ -9,7 +9,7 @@ class SetupLibraryUpdateMigration : Migration {
|
|||
override val version: Float = Migration.ALWAYS
|
||||
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context = migrationContext.get<App>() ?: return false
|
||||
val context = migrationContext.get<Application>() ?: return false
|
||||
LibraryUpdateJob.setupTask(context)
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue