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

Possibility to change the download URL when it expires #26

Closed
MaciekZ-NHM opened this issue Apr 20, 2017 · 4 comments
Closed

Possibility to change the download URL when it expires #26

MaciekZ-NHM opened this issue Apr 20, 2017 · 4 comments
Assignees

Comments

@MaciekZ-NHM
Copy link

Hello, i would like to use this library into my project, but i have one problem.
I have download URL with expiration time, and when user pause download, expiration time is over, and user want to resume download, fetcher give me STATUS_ERROR, that is fine.
My ask is: is there any possibility to change download URL to continue download file with different download link?
Because for now i can't continue download, i need to remove request and starts again, losing proviously dowloaded part of the file.

@tonyofrancis
Copy link
Owner

@MaciekZ-NHM This is a very interesting scenario. It is possible to implement this in Fetch. I would have to find/test for the best way to implement this feature and to also test for the effects this can have on the library. Let me circle back back in a day.

@MaciekZ-NHM
Copy link
Author

MaciekZ-NHM commented Apr 24, 2017

@tonyofrancis Thank you for the quick answer, I'll wait ;)

@tonyofrancis
Copy link
Owner

@MaciekZ-NHM Still looking into this. I will keep this thread updated

@tonyofrancis
Copy link
Owner

@MaciekZ-NHM Version 1.1.1 has been pushed and contains a new method fetch.updateUrlForRequest(id,url). This will allow you to update the url of a download request that has been enqueued. If a url expires and the download cannot continue, The request status will be set to Fetch.STATUS_ERROR and fetch listeners will be alerted. After updating a request's url, it status will automatically be set to Fetch.STATUS_QUEUED and fetch will try to continue the download.

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

No branches or pull requests

2 participants