mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +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 {
|
object LocalBook {
|
||||||
|
|
||||||
private const val folderName = "bookTxt"
|
|
||||||
val cacheFolder: File by lazy {
|
|
||||||
FileUtils.createFolderIfNotExist(appCtx.externalFiles, folderName)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Throws(FileNotFoundException::class, SecurityException::class)
|
@Throws(FileNotFoundException::class, SecurityException::class)
|
||||||
fun getBookInputStream(book: Book): InputStream {
|
fun getBookInputStream(book: Book): InputStream {
|
||||||
val uri = Uri.parse(book.bookUrl)
|
val uri = Uri.parse(book.bookUrl)
|
||||||
@ -168,15 +163,6 @@ object LocalBook {
|
|||||||
|
|
||||||
fun deleteBook(book: Book, deleteOriginal: Boolean) {
|
fun deleteBook(book: Book, deleteOriginal: Boolean) {
|
||||||
kotlin.runCatching {
|
kotlin.runCatching {
|
||||||
if (book.isLocalTxt() || book.isUmd()) {
|
|
||||||
cacheFolder.getFile(book.originName).delete()
|
|
||||||
}
|
|
||||||
if (book.isEpub()) {
|
|
||||||
FileUtils.delete(
|
|
||||||
cacheFolder.getFile(book.getFolderName())
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (deleteOriginal) {
|
if (deleteOriginal) {
|
||||||
if (book.bookUrl.isContentScheme()) {
|
if (book.bookUrl.isContentScheme()) {
|
||||||
val uri = Uri.parse(book.bookUrl)
|
val uri = Uri.parse(book.bookUrl)
|
||||||
|
Loading…
Reference in New Issue
Block a user