@@ -1499,17 +1499,36 @@ class DepotDownloader @JvmOverloads constructor(
14991499
15001500 logger?.debug(" %.2f%% %s" .format(depotPercentage, fileFinalPath))
15011501 } else {
1502- // Just update counters without notifying
1502+ // Update counters and notify on chunk completion
1503+ val sizeDownloaded: Long
1504+ val depotPercentage: Float
1505+ val compressedBytes: Long
1506+ val uncompressedBytes: Long
1507+
15031508 synchronized(depotDownloadCounter) {
15041509 depotDownloadCounter.sizeDownloaded + = written.toLong()
15051510 depotDownloadCounter.depotBytesCompressed + = chunk.compressedLength
15061511 depotDownloadCounter.depotBytesUncompressed + = chunk.uncompressedLength
1512+
1513+ sizeDownloaded = depotDownloadCounter.sizeDownloaded
1514+ compressedBytes = depotDownloadCounter.depotBytesCompressed
1515+ uncompressedBytes = depotDownloadCounter.depotBytesUncompressed
1516+ depotPercentage = (sizeDownloaded.toFloat() / depotDownloadCounter.completeDownloadSize)
15071517 }
15081518
15091519 synchronized(downloadCounter) {
15101520 downloadCounter.totalBytesCompressed + = chunk.compressedLength
15111521 downloadCounter.totalBytesUncompressed + = chunk.uncompressedLength
15121522 }
1523+
1524+ notifyListeners { listener ->
1525+ listener.onChunkCompleted(
1526+ depotId = depot.depotId,
1527+ depotPercentComplete = depotPercentage,
1528+ compressedBytes = compressedBytes,
1529+ uncompressedBytes = uncompressedBytes
1530+ )
1531+ }
15131532 }
15141533 }
15151534
0 commit comments