优化
This commit is contained in:
@@ -22,6 +22,7 @@ import okhttp3.internal.notifyAll
|
|||||||
import okhttp3.internal.wait
|
import okhttp3.internal.wait
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
import okio.BufferedSink
|
import okio.BufferedSink
|
||||||
|
import okio.ByteString.Companion.encode
|
||||||
import okio.Pipe
|
import okio.Pipe
|
||||||
import okio.Timeout
|
import okio.Timeout
|
||||||
import okio.buffer
|
import okio.buffer
|
||||||
@@ -212,7 +213,7 @@ class ObsoleteUrlFactory(private var client: OkHttpClient) : URLStreamHandlerFac
|
|||||||
val headers = headers
|
val headers = headers
|
||||||
if (position < 0 || position >= headers.size) null else headers.value(
|
if (position < 0 || position >= headers.size) null else headers.value(
|
||||||
position
|
position
|
||||||
)
|
).encode().string(Charsets.ISO_8859_1)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ class MainViewModel(application: Application) : BaseViewModel(application) {
|
|||||||
}
|
}
|
||||||
appDb.bookChapterDao.delByBook(bookUrl)
|
appDb.bookChapterDao.delByBook(bookUrl)
|
||||||
appDb.bookChapterDao.insert(*toc.toTypedArray())
|
appDb.bookChapterDao.insert(*toc.toTypedArray())
|
||||||
if (book.isSameNameAuthor(ReadBook)) {
|
if (book.isSameNameAuthor(ReadBook.book)) {
|
||||||
ReadBook.book = book
|
ReadBook.book = book
|
||||||
ReadBook.chapterSize = book.totalChapterNum
|
ReadBook.chapterSize = book.totalChapterNum
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user