mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
* 正文出现缺字漏字、内容缺失、排版错乱等情况,有可能是净化规则或简繁转换出现问题。
|
||||
* 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源!
|
||||
|
||||
**2022/02/26**
|
||||
|
||||
* 自动备份检测到webDav已有备份时不会重复备份
|
||||
|
||||
**2022/02/25**
|
||||
|
||||
* 修复排版导入不能导入背景图片的bug
|
||||
|
||||
@@ -52,7 +52,9 @@ object Backup : BackupRestore() {
|
||||
if (lastBackup + TimeUnit.DAYS.toMillis(1) < System.currentTimeMillis()) {
|
||||
Coroutine.async {
|
||||
if (!AppWebDav.hasBackUp()) {
|
||||
backup(context, context.getPrefString(PreferKey.backupPath) ?: "", true)
|
||||
backup(context, context.getPrefString(PreferKey.backupPath), true)
|
||||
} else {
|
||||
context.putPrefLong(PreferKey.lastBackup, System.currentTimeMillis())
|
||||
}
|
||||
}.onError {
|
||||
AppLog.put("备份出错\n${it.localizedMessage}", it)
|
||||
@@ -61,7 +63,7 @@ object Backup : BackupRestore() {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun backup(context: Context, path: String, isAuto: Boolean = false) {
|
||||
suspend fun backup(context: Context, path: String?, isAuto: Boolean = false) {
|
||||
context.putPrefLong(PreferKey.lastBackup, System.currentTimeMillis())
|
||||
withContext(IO) {
|
||||
FileUtils.deleteFile(backupPath)
|
||||
@@ -105,12 +107,14 @@ object Backup : BackupRestore() {
|
||||
edit.commit()
|
||||
}
|
||||
AppWebDav.backUpWebDav(backupPath)
|
||||
if (path.isContentScheme()) {
|
||||
copyBackup(context, Uri.parse(path), isAuto)
|
||||
} else {
|
||||
if (path.isEmpty()) {
|
||||
when {
|
||||
path.isNullOrBlank() -> {
|
||||
copyBackup(context.getExternalFilesDir(null)!!, false)
|
||||
} else {
|
||||
}
|
||||
path.isContentScheme() -> {
|
||||
copyBackup(context, Uri.parse(path), isAuto)
|
||||
}
|
||||
else -> {
|
||||
copyBackup(File(path), isAuto)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user