mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
refactor: Retrieve auto backup directory from Uri argument
This commit is contained in:
parent
c6c6ed0553
commit
e248de76d7
1 changed files with 1 additions and 2 deletions
|
@ -37,7 +37,6 @@ class BackupCreator(
|
||||||
val parser = ProtoBuf
|
val parser = ProtoBuf
|
||||||
private val db: DatabaseHelper = Injekt.get()
|
private val db: DatabaseHelper = Injekt.get()
|
||||||
private val backupPreferences: BackupPreferences = Injekt.get()
|
private val backupPreferences: BackupPreferences = Injekt.get()
|
||||||
private val storageManager: StorageManager by injectLazy()
|
|
||||||
|
|
||||||
@Suppress("RedundantSuspendModifier")
|
@Suppress("RedundantSuspendModifier")
|
||||||
private suspend fun getDatabaseManga(includeReadManga: Boolean) = db.inTransactionReturn {
|
private suspend fun getDatabaseManga(includeReadManga: Boolean) = db.inTransactionReturn {
|
||||||
|
@ -60,7 +59,7 @@ class BackupCreator(
|
||||||
try {
|
try {
|
||||||
file = if (isAutoBackup) {
|
file = if (isAutoBackup) {
|
||||||
// Get dir of file and create
|
// Get dir of file and create
|
||||||
val dir = storageManager.getAutomaticBackupsDirectory()
|
val dir = UniFile.fromUri(context, uri)
|
||||||
|
|
||||||
// Delete older backups
|
// Delete older backups
|
||||||
val numberOfBackups = backupPreferences.numberOfBackups().get()
|
val numberOfBackups = backupPreferences.numberOfBackups().get()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue