diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index a93a0606f..7635df1f7 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/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() }