pull/84/head
kunfei 5 years ago
parent 2469983166
commit 2d2adfc8ef
  1. 8
      app/src/main/java/io/legado/app/help/BookHelp.kt

@ -60,12 +60,14 @@ object BookHelp {
DocumentUtils.getDirDocument(
root,
subDirs = *arrayOf(cacheFolderName, bookFolderName(book))
)?.listFiles()?.forEach {
if (it.name?.startsWith(String.format("%05d", bookChapter.index)) == true) {
it.delete()
)?.uri?.let { uri ->
DocumentUtils.listFiles(App.INSTANCE, uri).forEach {
if (it.name.startsWith(String.format("%05d", bookChapter.index))) {
DocumentFile.fromSingleUri(App.INSTANCE, it.uri)?.delete()
return@forEach
}
}
}
DocumentUtils.createFileIfNotExist(
root,
"${bookChapterName(bookChapter)}.nb",

Loading…
Cancel
Save