Merge pull request #3221 from dreampiggy/bugfix_original_cache_miss_continue_download

Fix the bug that when querying original cache miss, the download process will be skipped. This is not designed behavior.
This commit is contained in:
DreamPiggy 2021-04-23 19:50:30 +08:00 committed by GitHub
commit a4199067ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -333,6 +333,10 @@ static id<SDImageLoader> _defaultImageLoader;
[self callCompletionBlockForOperation:operation completion:completedBlock error:[NSError errorWithDomain:SDWebImageErrorDomain code:SDWebImageErrorCancelled userInfo:@{NSLocalizedDescriptionKey : @"Operation cancelled by user during querying the cache"}] url:url]; [self callCompletionBlockForOperation:operation completion:completedBlock error:[NSError errorWithDomain:SDWebImageErrorDomain code:SDWebImageErrorCancelled userInfo:@{NSLocalizedDescriptionKey : @"Operation cancelled by user during querying the cache"}] url:url];
[self safelyRemoveOperationFromRunning:operation]; [self safelyRemoveOperationFromRunning:operation];
return; return;
} else if (context[SDWebImageContextImageTransformer] && !cachedImage) {
// Original image cache miss. Continue download process
[self callDownloadProcessForOperation:operation url:url options:options context:context cachedImage:nil cachedData:nil cacheType:originalQueryCacheType progress:progressBlock completed:completedBlock];
return;
} }
// Use the store cache process instead of downloading, and ignore .refreshCached option for now // Use the store cache process instead of downloading, and ignore .refreshCached option for now