Authored by Elio Gonzalez
Committed by Olivier Poitrey

Force retry of failed downloads

... ... @@ -22,6 +22,7 @@
+ (id)sharedManager;
- (UIImage *)imageWithURL:(NSURL *)url;
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate;
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate retryFailed:(BOOL)retryFailed;
- (void)cancelForDelegate:(id<SDWebImageManagerDelegate>)delegate;
@end
... ...
... ... @@ -56,7 +56,12 @@ static SDWebImageManager *instance;
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate
{
if (!url || !delegate || [failedURLs containsObject:url])
[self downloadWithURL: url delegate:delegate retryFailed:NO];
}
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate retryFailed:(BOOL)retryFailed
{
if (!url || !delegate || (!retryFailed && [failedURLs containsObject:url]))
{
return;
}
... ...