Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement way to ignore if already downloaded or is completed #9

Open
edelciomolina opened this issue Feb 13, 2020 · 1 comment
Open

Comments

@edelciomolina
Copy link

edelciomolina commented Feb 13, 2020

Create a way that we can decide if the files already downloads (since really fully completed) have to be downloaded again or not. I noted on some tests that the download always starts again.

Ideas:

  • Check local file header "last-modified" and compare with the remote file is newer.
  • Check local file header "content-length" and compare with the remote file to know it was download correctly.
@minhnhut
Copy link
Owner

minhnhut commented Mar 5, 2020

hi @edelciomolina

Thank you very much for your idea. Hmm, I think it is more complicated than it sounds.

Currently I am working on #1, to add ability to stop downloading completely, and then resume later.
And I am also working on file name conflict resolving, which might happen when DownloadWorker try to finish up - joining files (Other file with same name as downloading file exists, etc.)

I am going to introduce some more options to allow customize DownloadWorker's strategy when file name conflict happened. Some strategies may be:

  • Skip it, do nothing
  • Same name, with increment number suffix like Windows/Macosx do: Filename (1).docx, Filename (2).docx, etc.

Other than that, I would like to leave it to userland, to handle if they really want to download file again, or skip it. Maybe by checking file "last-modified" or "content-length" as you said. But I doubt it, because:

  • "last-modified" is a optional cache control header, not all site and its resource include this in header.
  • "content-length" is hard to judge if file is same. For example, two .txt file with content: "File" and "file" will have same content-length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants