Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Add download resume support #3246

Merged

Conversation

garrettmoon
Copy link
Contributor

Adds resume support support for image downloads that have exited preload range (only on ASNetworkImageNode currently).

Copy link
Contributor

@nguyenhuy nguyenhuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm super excited! Please address a few nits before merging.

`downloadImageWithURL:callbackQueue:downloadProgressBlock:completion:`.
@discussion This method has no effect if `downloadIdentifier` is nil. If implemented, this method
may be called instead of `cancelImageDownloadForIdentifier:` in cases where ASDK believes there's a chance
the image download will be resumed (currently when an image exits display range). You can use this to store
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "currently when an image exits preload range"

@@ -107,7 +109,7 @@ - (instancetype)init

- (void)dealloc
{
[self _cancelImageDownload];
[self _cancelImageDownload:NO];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new boolean param passed to _cancelImageDownload: is not descriptive and thus a bit confusing. How about _cancelImageDownloadWithResumePossibility:? Same concern for _cancelDownloadAndClearImage: and their _locked variants.

@garrettmoon garrettmoon merged commit 68a8d5f into facebookarchive:master Apr 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants