Skip to content

Commit

Permalink
Fix prefetcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
K1rakishou committed Feb 17, 2024
1 parent 5e44af5 commit 7cb4359
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,12 @@ class PrefetchLoader(
cancelableDownload.addCallback(object : FileCacheListener() {
override fun onStart(chunksCount: Int) {
super.onStart(chunksCount)
require(chunksCount == 1) { "Bad chunksCount for prefetch: $chunksCount" }

onPrefetchStarted(prefetch.postImage)
}

override fun onProgress(chunkIndex: Int, downloaded: Long, total: Long) {
super.onProgress(chunkIndex, downloaded, total)
require(chunkIndex == 0) { "Bad chunkIndex for prefetch: $chunkIndex" }

val progress = if (total != 0L) {
downloaded.toFloat() / total.toFloat()
Expand Down

0 comments on commit 7cb4359

Please sign in to comment.