pull/83/head
kunfei 6 years ago
parent d5f9f15393
commit 42b7c6d771
  1. 12
      app/src/main/java/io/legado/app/help/BookHelp.kt

@ -128,11 +128,11 @@ object BookHelp {
fun getContent(book: Book, bookChapter: BookChapter): String? { fun getContent(book: Book, bookChapter: BookChapter): String? {
if (downloadUri.isDocumentUri(App.INSTANCE)) { if (downloadUri.isDocumentUri(App.INSTANCE)) {
DocumentFile.fromTreeUri(App.INSTANCE, downloadUri)?.let { root -> DocumentFile.fromTreeUri(App.INSTANCE, downloadUri)?.let { root ->
return DocumentUtils.createFileIfNotExist( return DocumentUtils.getDirDocument(
root, root,
"${bookChapterName(bookChapter)}.nb",
subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) subDirs = *arrayOf(cacheFolderName, bookFolderName(book))
)?.uri?.readText(App.INSTANCE) )?.findFile("${bookChapterName(bookChapter)}.nb")
?.uri?.readText(App.INSTANCE)
} }
} else { } else {
return FileUtils.createFileIfNotExist( return FileUtils.createFileIfNotExist(
@ -225,9 +225,9 @@ object BookHelp {
return newIndex return newIndex
} }
var bookName: String? = null private var bookName: String? = null
var bookOrigin: String? = null private var bookOrigin: String? = null
var replaceRules: List<ReplaceRule> = arrayListOf() private var replaceRules: List<ReplaceRule> = arrayListOf()
fun disposeContent( fun disposeContent(
title: String, title: String,

Loading…
Cancel
Save