mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
refactor(backup): Inject storageManager inside getAutomaticBackupLocation func
This commit is contained in:
parent
a7a6dc96d3
commit
822cfa56a6
1 changed files with 4 additions and 4 deletions
|
@ -29,7 +29,6 @@ import eu.kanade.tachiyomi.util.system.workManager
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
import uy.kohesive.injekt.injectLazy
|
|
||||||
import yokai.domain.backup.BackupPreferences
|
import yokai.domain.backup.BackupPreferences
|
||||||
import yokai.domain.storage.StorageManager
|
import yokai.domain.storage.StorageManager
|
||||||
|
|
||||||
|
@ -37,7 +36,6 @@ class BackupCreatorJob(private val context: Context, workerParams: WorkerParamet
|
||||||
CoroutineWorker(context, workerParams) {
|
CoroutineWorker(context, workerParams) {
|
||||||
|
|
||||||
private val notifier = BackupNotifier(context.localeContext)
|
private val notifier = BackupNotifier(context.localeContext)
|
||||||
private val storageManager: StorageManager by injectLazy()
|
|
||||||
|
|
||||||
override suspend fun doWork(): Result {
|
override suspend fun doWork(): Result {
|
||||||
val isAutoBackup = inputData.getBoolean(IS_AUTO_BACKUP_KEY, true)
|
val isAutoBackup = inputData.getBoolean(IS_AUTO_BACKUP_KEY, true)
|
||||||
|
@ -74,8 +72,10 @@ class BackupCreatorJob(private val context: Context, workerParams: WorkerParamet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getAutomaticBackupLocation(): Uri? =
|
private fun getAutomaticBackupLocation(): Uri? {
|
||||||
storageManager.getAutomaticBackupsDirectory()?.uri
|
val storageManager = Injekt.get<StorageManager>()
|
||||||
|
return storageManager.getAutomaticBackupsDirectory()?.uri
|
||||||
|
}
|
||||||
|
|
||||||
override suspend fun getForegroundInfo(): ForegroundInfo {
|
override suspend fun getForegroundInfo(): ForegroundInfo {
|
||||||
return ForegroundInfo(
|
return ForegroundInfo(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue