Permalink
Browse files

Force retry of failed downloads

  • Loading branch information...
1 parent 20b8cdf commit ee153fee04e54ecb4110430ca26758149046d804 @eliog eliog committed with rs Oct 5, 2010
Showing with 7 additions and 1 deletion.
  1. +1 −0 SDWebImageManager.h
  2. +6 −1 SDWebImageManager.m
View
1 SDWebImageManager.h
@@ -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
View
7 SDWebImageManager.m
@@ -56,7 +56,12 @@ - (UIImage *)imageWithURL:(NSURL *)url
- (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;
}

0 comments on commit ee153fe

Please sign in to comment.