Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Nov 12, 2023
1 parent ba9d757 commit 17998fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/io/legado/app/data/entities/BookSource.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 17998fb

Please sign in to comment.