Skip to content

Commit

Permalink
[fix/ISSUE-23] Skip download if file exists with same size as URL
Browse files Browse the repository at this point in the history
  • Loading branch information
azihassan committed Oct 5, 2023
1 parent 48a140a commit d6e7c4e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/downloaders.d
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ class ParallelDownloader : Downloader
{
ulong length = url.getContentLength();
logger.displayVerbose("Length = ", length);
if(destination.exists() && destination.getSize() == length)
{
logger.display("Done !".formatSuccess());
return;
}

int chunks = 4;
string[] destinations = new string[chunks];
foreach(i, e; iota(0, chunks).parallel)
Expand Down

0 comments on commit d6e7c4e

Please sign in to comment.