Add Migration for autoDownloadWhileReading

This commit is contained in:
Jays2Kings 2022-08-28 15:06:04 -04:00
parent c209836e77
commit c2bd98b56a

View file

@ -22,6 +22,7 @@ import kotlinx.coroutines.CoroutineScope
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.io.File
import kotlin.math.max
object Migrations {
@ -202,6 +203,12 @@ object Migrations {
preferences.secureScreen().set(PreferenceValues.SecureScreenMode.ALWAYS)
}
}
if (oldVersion < 97) {
val oldDLAfterReading = prefs.getInt("auto_download_after_reading", 0)
if (oldDLAfterReading > 0) {
preferences.autoDownloadWhileReading().set(max(2, oldDLAfterReading))
}
}
return true
}