pull/83/head
kunfei 5 years ago
parent cf8f5e1811
commit 1fff1bcb46
  1. 5
      app/src/main/java/io/legado/app/help/BookHelp.kt

@ -33,7 +33,7 @@ object BookHelp {
}
private fun bookChapterName(bookChapter: BookChapter): String {
return String.format("%05d-%s", bookChapter.index, MD5Utils.md5Encode(bookChapter.title))
return String.format("%05d-%s", bookChapter.index, MD5Utils.md5Encode16(bookChapter.title))
}
fun clearCache() {
@ -135,12 +135,11 @@ object BookHelp {
?.uri?.readText(App.INSTANCE)
}
} else {
val path = FileUtils.getPath(
val file = FileUtils.getFile(
File(downloadPath),
"${bookChapterName(bookChapter)}.nb",
subDirs = *arrayOf(cacheFolderName, bookFolderName(book))
)
val file = File(path)
if (file.exists()) {
return file.readText()
}

Loading…
Cancel
Save