Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit 29d0cce

Browse files
committed
use actual file size instead of fragment size when resuming downloads
1 parent a6fbea2 commit 29d0cce

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

funimation/downloader/download.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ func (d *Downloader) Download(destFileName string, threads int) (int64, error) {
4848
if finfo, err := os.Stat(fpath); err == nil {
4949
if finfo.Size() == job.byteEnd - job.byteStart + 1 {
5050
// assume same size is synonymous with same file
51-
52-
d.OnBytesReceived(int(d.FragmentSize))
51+
d.OnBytesReceived(int(finfo.Size()))
5352

5453
fragmentPaths[job.index] = fpath
5554
errsChan <- nil

0 commit comments

Comments
 (0)