Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class BookDownloader(private val context: Context) {
const val BOOKS_FOLDER = "ebooks"
const val TEMP_FOLDER = "temp_books"
private const val MAX_FILENAME_LENGTH = 100
private const val DOWNLOAD_POLL_INTERVAL_MS = 250L

/**
* Sanitizes book title by replacing forbidden chars which are not allowed
Expand Down Expand Up @@ -195,6 +196,7 @@ class BookDownloader(private val context: Context) {
downloadProgressListener(progress, status)
runningDownloads[book.id]?.progress?.value = progress
cursor.close()
if (!isDownloadFinished) delay(DOWNLOAD_POLL_INTERVAL_MS)
}
/**
Remove download from running downloads when loop ends.
Expand Down
Loading