|
|
@ -66,8 +66,10 @@ class MainViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
|
|
|
|
|
|
|
|
@Synchronized |
|
|
|
@Synchronized |
|
|
|
private fun updateToc() { |
|
|
|
private fun updateToc() { |
|
|
|
|
|
|
|
var update = false |
|
|
|
bookMap.forEach { bookEntry -> |
|
|
|
bookMap.forEach { bookEntry -> |
|
|
|
if (!updateList.contains(bookEntry.key)) { |
|
|
|
if (!updateList.contains(bookEntry.key)) { |
|
|
|
|
|
|
|
update = true |
|
|
|
val book = bookEntry.value |
|
|
|
val book = bookEntry.value |
|
|
|
synchronized(this) { |
|
|
|
synchronized(this) { |
|
|
|
updateList.add(book.bookUrl) |
|
|
|
updateList.add(book.bookUrl) |
|
|
@ -105,6 +107,9 @@ class MainViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!update) { |
|
|
|
|
|
|
|
usePoolCount-- |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun cacheBook(webBook: WebBook, book: Book) { |
|
|
|
private fun cacheBook(webBook: WebBook, book: Book) { |
|
|
|