优化
This commit is contained in:
@@ -28,6 +28,7 @@ import io.legado.app.help.coroutine.Coroutine
|
|||||||
import io.legado.app.help.http.Cronet
|
import io.legado.app.help.http.Cronet
|
||||||
import io.legado.app.help.http.ObsoleteUrlFactory
|
import io.legado.app.help.http.ObsoleteUrlFactory
|
||||||
import io.legado.app.help.http.okHttpClient
|
import io.legado.app.help.http.okHttpClient
|
||||||
|
import io.legado.app.help.source.SourceHelp
|
||||||
import io.legado.app.model.BookCover
|
import io.legado.app.model.BookCover
|
||||||
import io.legado.app.utils.defaultSharedPreferences
|
import io.legado.app.utils.defaultSharedPreferences
|
||||||
import io.legado.app.utils.getPrefBoolean
|
import io.legado.app.utils.getPrefBoolean
|
||||||
@@ -73,6 +74,8 @@ class App : Application() {
|
|||||||
1 -> ChineseUtils.preLoad(true, TransType.TRADITIONAL_TO_SIMPLE)
|
1 -> ChineseUtils.preLoad(true, TransType.TRADITIONAL_TO_SIMPLE)
|
||||||
2 -> ChineseUtils.preLoad(true, TransType.SIMPLE_TO_TRADITIONAL)
|
2 -> ChineseUtils.preLoad(true, TransType.SIMPLE_TO_TRADITIONAL)
|
||||||
}
|
}
|
||||||
|
//调整排序序号
|
||||||
|
SourceHelp.adjustSortNumber()
|
||||||
//同步阅读记录
|
//同步阅读记录
|
||||||
if (AppConfig.syncBookProgress) {
|
if (AppConfig.syncBookProgress) {
|
||||||
AppWebDav.downloadAllBookProgress()
|
AppWebDav.downloadAllBookProgress()
|
||||||
|
|||||||
@@ -74,4 +74,18 @@ object SourceHelp {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调整排序序号
|
||||||
|
*/
|
||||||
|
fun adjustSortNumber() {
|
||||||
|
if (
|
||||||
|
appDb.bookSourceDao.maxOrder > 99999
|
||||||
|
|| appDb.bookSourceDao.minOrder < -99999
|
||||||
|
) {
|
||||||
|
appDb.bookSourceDao.all.forEachIndexed { index, bookSource ->
|
||||||
|
appDb.bookSourceDao.upOrder(bookSource.bookSourceUrl, index)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,9 @@ import splitties.init.appCtx
|
|||||||
import java.util.concurrent.locks.LockSupport
|
import java.util.concurrent.locks.LockSupport
|
||||||
import kotlin.time.Duration.Companion.minutes
|
import kotlin.time.Duration.Companion.minutes
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 源验证
|
||||||
|
*/
|
||||||
object SourceVerificationHelp {
|
object SourceVerificationHelp {
|
||||||
|
|
||||||
private val waitTime = 1.minutes.inWholeNanoseconds
|
private val waitTime = 1.minutes.inWholeNanoseconds
|
||||||
|
|||||||
Reference in New Issue
Block a user