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