mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
ba9d75706e
commit
17998fb6db
@ -206,7 +206,9 @@ data class BookSource(
|
||||
&& enabled == source.enabled
|
||||
&& enabledExplore == source.enabledExplore
|
||||
&& enabledCookieJar == source.enabledCookieJar
|
||||
&& equal(variableComment, source.variableComment)
|
||||
&& equal(concurrentRate, source.concurrentRate)
|
||||
&& equal(jsLib, source.jsLib)
|
||||
&& equal(header, source.header)
|
||||
&& equal(loginUrl, source.loginUrl)
|
||||
&& equal(loginUi, source.loginUi)
|
||||
|
@ -41,14 +41,13 @@ class BookSourceEditViewModel(application: Application) : BaseViewModel(applicat
|
||||
if (source.bookSourceUrl.isBlank() || source.bookSourceName.isBlank()) {
|
||||
throw NoStackTraceException(context.getString(R.string.non_null_name_url))
|
||||
}
|
||||
if (source.equal(bookSource ?: BookSource())) {
|
||||
return@execute source
|
||||
if (!source.equal(bookSource ?: BookSource())) {
|
||||
source.lastUpdateTime = System.currentTimeMillis()
|
||||
}
|
||||
bookSource?.let {
|
||||
appDb.bookSourceDao.delete(it)
|
||||
SourceConfig.removeSource(it.bookSourceUrl)
|
||||
}
|
||||
source.lastUpdateTime = System.currentTimeMillis()
|
||||
appDb.bookSourceDao.insert(source)
|
||||
bookSource = source
|
||||
source
|
||||
|
Loading…
Reference in New Issue
Block a user