From 920a5b60929ff0cb89da73f8964c099358e2837a Mon Sep 17 00:00:00 2001 From: MyC Date: Thu, 25 Sep 2025 20:18:11 +0800 Subject: [PATCH] fix: determine if it is the last chunk --- src/Save/ParallelSave.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Save/ParallelSave.php b/src/Save/ParallelSave.php index eacbf42..d77c0c6 100644 --- a/src/Save/ParallelSave.php +++ b/src/Save/ParallelSave.php @@ -79,7 +79,9 @@ protected function handleChunkFile($file) $percentage = floor((count($this->foundChunks)) / $this->handler()->getTotalChunks() * 100); // We need to update the handler with correct percentage $this->handler()->setPercentageDone($percentage); - $this->isLastChunk = $percentage >= 100; + + // determine if it is the last chunk + $this->isLastChunk = $this->handler()->getCurrentChunk() >= $this->handler()->getTotalChunks(); return $this; }