mirror of
https://github.com/gedoor/legado.git
synced 2024-07-17 00:58:29 +08:00
localBook.kt:remove ununsed codes
This commit is contained in:
parent
3357db03f4
commit
8628f35ff5
@ -24,11 +24,6 @@ import javax.script.SimpleBindings
|
||||
|
||||
object LocalBook {
|
||||
|
||||
private const val folderName = "bookTxt"
|
||||
val cacheFolder: File by lazy {
|
||||
FileUtils.createFolderIfNotExist(appCtx.externalFiles, folderName)
|
||||
}
|
||||
|
||||
@Throws(FileNotFoundException::class, SecurityException::class)
|
||||
fun getBookInputStream(book: Book): InputStream {
|
||||
val uri = Uri.parse(book.bookUrl)
|
||||
@ -168,15 +163,6 @@ object LocalBook {
|
||||
|
||||
fun deleteBook(book: Book, deleteOriginal: Boolean) {
|
||||
kotlin.runCatching {
|
||||
if (book.isLocalTxt() || book.isUmd()) {
|
||||
cacheFolder.getFile(book.originName).delete()
|
||||
}
|
||||
if (book.isEpub()) {
|
||||
FileUtils.delete(
|
||||
cacheFolder.getFile(book.getFolderName())
|
||||
)
|
||||
}
|
||||
|
||||
if (deleteOriginal) {
|
||||
if (book.bookUrl.isContentScheme()) {
|
||||
val uri = Uri.parse(book.bookUrl)
|
||||
|
Loading…
Reference in New Issue
Block a user