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

skip download if file already downloaded #17

Open
arvryna opened this issue Aug 1, 2021 · 4 comments
Open

skip download if file already downloaded #17

arvryna opened this issue Aug 1, 2021 · 4 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@arvryna
Copy link
Owner

arvryna commented Aug 1, 2021

  • check bytes and then verify download completion
@setraj
Copy link
Collaborator

setraj commented Aug 7, 2021

I need a little clarification on this issue.
If I understood it correctly, we need to check for the size of the file along with the name of the file here.
I have one question here. If we found out that the file size doesn't match the content length but the file name is the same, in this case, can we proceed with the download? if yes then what do we do with the existing file?

@arvryna
Copy link
Owner Author

arvryna commented Aug 7, 2021

Good point, to make the user experience better, we can make a prompt to user for further actions

cases:

  1. If (name & size) matches => prompt user for action (y/n)=> if yes => start download with file_name-1.ext

  2. If we found out that the file size doesn't match the content length but the file name is the same : This cannot happen because the final file could have existed if and only if all the segments had successfully downloaded. There exist a possibility, that during the final stage (merging downloaded segments), if there will be an interruption, then file may be incomplete but we need to test this claim. I haven't faced it during the download and testing phase

@setraj
Copy link
Collaborator

setraj commented Aug 8, 2021

In case 2 above, the user could have a different useful file with the same name but less size in the same directory.

I believe we may proceed with the download everytime when the user tries with a file_name-{some_uniuqe_identifier} in case of file name collision.

@arvryna
Copy link
Owner Author

arvryna commented Aug 8, 2021

In case 2 above, the user could have a different useful file with the same name but less size in the same directory.

I believe we may proceed with the download everytime when the user tries with a file_name-{some_uniuqe_identifier} in case of file name collision.

This is the best decision, fully agreed

@arvryna arvryna added the good first issue Good for newcomers label Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants