@ -162,6 +162,7 @@ class CacheBook(val bookSource: BookSource, val book: Book) {
}.onError {
onDownloadSet.remove(chapterIndex)
waitDownloadSet.add(chapterIndex)
print(it.localizedMessage)
addLog("${book.name}-${chapter.title} getContentError${it.localizedMessage}")
downloadFinish(chapter, it.localizedMessage ?: "download error")
}.onCancel {
@ -82,6 +82,9 @@ class CacheBookService : BaseService() {
private fun removeDownload(bookUrl: String?) {
CacheBook.cacheBookMap.remove(bookUrl)
if (CacheBook.cacheBookMap.isEmpty()) {
stopSelf()
}
private fun download() {