Skip to content

Commit

Permalink
fixed zero sized download size
Browse files Browse the repository at this point in the history
  • Loading branch information
LagradOst committed Aug 16, 2023
1 parent 6d5cfa5 commit b0e425e
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions app/src/main/java/com/lagradost/quicknovel/BookDownloader2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,24 @@ object BookDownloader2Helper {
), LOCAL_EPUB
)

val count = if (epub.exists() && epub.length() > LOCAL_EPUB_MIN_SIZE) 1 else File(
context.filesDir.toString() + getDirectory(
sApiname,
sAuthor,
sName
)
).listFiles()?.count { it.name.endsWith(".txt") } ?: return null
val count =
if (epub.exists()) {
val length = epub.length()
if(length > LOCAL_EPUB_MIN_SIZE) {
1
} else {
0
}
} else {
File(
context.filesDir.toString() + getDirectory(
sApiname,
sAuthor,
sName
)
).listFiles()?.count { it.name.endsWith(".txt") } ?: return null
}
if(count <= 0) return null

/*var sStart = start
if (sStart == -1) { // CACHE DATA
Expand Down

0 comments on commit b0e425e

Please sign in to comment.