Mhurd has submitted this change and it was merged.
Change subject: Image caching -- sorta working? :D
......................................................................
Image caching -- sorta working? :D
- saving stub image info to individual .plist files as well as in a straight
URL list for the article
-- may want to break the list down to per-section if we want to replicate some
previous behaviors
- went with shorter filenames (last filename only without path info), may break
in some rare corner cases but the long ones were breaking frequently
- using the live session articleStore for caching so it actually uses the right
article!
This doesn't yet handle thumbnails in list pages real well, as global cache
doesn't know
which article is which.
Change-Id: I923a7f6f2eb58d03edc9d3b7efe68c98595e9acb
---
M MediaWikiKit/MediaWikiKit.xcodeproj/project.pbxproj
M MediaWikiKit/MediaWikiKit/MWKArticleStore.h
M MediaWikiKit/MediaWikiKit/MWKArticleStore.m
M MediaWikiKit/MediaWikiKit/MWKDataStore.m
M MediaWikiKit/MediaWikiKit/MWKImage.h
M MediaWikiKit/MediaWikiKit/MWKImage.m
A MediaWikiKit/MediaWikiKit/MWKImageList.h
A MediaWikiKit/MediaWikiKit/MWKImageList.m
M MediaWikiKit/MediaWikiKit/MediaWikiKit.h
M wikipedia/Networking/Fetchers/ArticleFetcher.m
M wikipedia/Web Image Interception/URLCache.m
11 files changed, 216 insertions(+), 33 deletions(-)
Approvals:
Mhurd: Verified; Looks good to me, approved
diff --git a/MediaWikiKit/MediaWikiKit.xcodeproj/project.pbxproj
b/MediaWikiKit/MediaWikiKit.xcodeproj/project.pbxproj
index cb1a3ba..af8a4f9 100644
--- a/MediaWikiKit/MediaWikiKit.xcodeproj/project.pbxproj
+++ b/MediaWikiKit/MediaWikiKit.xcodeproj/project.pbxproj
@@ -50,6 +50,8 @@
D49ADCCC1A0031580010F839 /* golden-gate.jpg in Resources */ =
{isa = PBXBuildFile; fileRef = D49ADCCB1A0031580010F839 /* golden-gate.jpg */;
};
D49ADCCE1A00346B0010F839 /* MWKArticleStoreTestCase.m in
Sources */ = {isa = PBXBuildFile; fileRef = D49ADCCD1A00346B0010F839 /*
MWKArticleStoreTestCase.m */; };
D4B94B1C1A2FB7D2007FC79B /* organization-anon.json in Resources
*/ = {isa = PBXBuildFile; fileRef = D4B94B1B1A2FB7D2007FC79B /*
organization-anon.json */; };
+ D4B94B1F1A2FE975007FC79B /* MWKImageList.m in Sources */ = {isa
= PBXBuildFile; fileRef = D4B94B1E1A2FE975007FC79B /* MWKImageList.m */; };
+ D4B94B201A2FE975007FC79B /* MWKImageList.m in Sources */ = {isa
= PBXBuildFile; fileRef = D4B94B1E1A2FE975007FC79B /* MWKImageList.m */; };
D4C3FA5519E4783A00EB08CC /* MWKSite.m in Sources */ = {isa =
PBXBuildFile; fileRef = D4C3FA5419E4783A00EB08CC /* MWKSite.m */; };
D4C3FA5A19E47AA500EB08CC /* MWKSiteTests.m in Sources */ = {isa
= PBXBuildFile; fileRef = D4C3FA5919E47AA500EB08CC /* MWKSiteTests.m */; };
D4C3FA5B19E47ABE00EB08CC /* MWKSite.m in Sources */ = {isa =
PBXBuildFile; fileRef = D4C3FA5419E4783A00EB08CC /* MWKSite.m */; };
@@ -130,6 +132,8 @@
D49ADCCD1A00346B0010F839 /* MWKArticleStoreTestCase.m */ = {isa
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc;
path = MWKArticleStoreTestCase.m; sourceTree = "<group>"; };
D49ADCCF1A0041570010F839 /* MWKArticleStoreTestCase.h */ = {isa
= PBXFileReference; lastKnownFileType = sourcecode.c.h; path =
MWKArticleStoreTestCase.h; sourceTree = "<group>"; };
D4B94B1B1A2FB7D2007FC79B /* organization-anon.json */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path =
"organization-anon.json"; sourceTree = "<group>"; };
+ D4B94B1D1A2FE975007FC79B /* MWKImageList.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
MWKImageList.h; sourceTree = "<group>"; };
+ D4B94B1E1A2FE975007FC79B /* MWKImageList.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= MWKImageList.m; sourceTree = "<group>"; };
D4C3FA5319E4783A00EB08CC /* MWKSite.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
MWKSite.h; sourceTree = "<group>"; };
D4C3FA5419E4783A00EB08CC /* MWKSite.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= MWKSite.m; sourceTree = "<group>"; };
D4C3FA5919E47AA500EB08CC /* MWKSiteTests.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= MWKSiteTests.m; sourceTree = "<group>"; };
@@ -272,6 +276,8 @@
D44EA7881A1BCD1400631A1D /*
MWKRecentSearchEntry.m */,
D44EA78B1A1BCD2600631A1D /*
MWKRecentSearchList.h */,
D44EA78C1A1BCD2600631A1D /*
MWKRecentSearchList.m */,
+ D4B94B1D1A2FE975007FC79B /* MWKImageList.h */,
+ D4B94B1E1A2FE975007FC79B /* MWKImageList.m */,
);
name = "Data classes";
sourceTree = "<group>";
@@ -412,6 +418,7 @@
D47F56281A1A89B4004D9856 /* MWKHistoryList.m in
Sources */,
D48405CF19E47572006F4139 /* MWKArticleStore.m
in Sources */,
D4612CED1A116E97008945A5 /* MWKSavedPageEntry.m
in Sources */,
+ D4B94B1F1A2FE975007FC79B /* MWKImageList.m in
Sources */,
D497FCE71A08013F004A36A5 /* MWKSavedPageList.m
in Sources */,
D4DDF45A19EDD22200C6BC10 /* MWKUser.m in
Sources */,
D48405C719E47542006F4139 /* MWKImage.m in
Sources */,
@@ -438,6 +445,7 @@
D4C3FA5D19E47D4700EB08CC /* MWKTitleTests.m in
Sources */,
D497FCE81A08013F004A36A5 /* MWKSavedPageList.m
in Sources */,
D494A71119F6ECC10098AA18 /*
MWKDataStorePathTests.m in Sources */,
+ D4B94B201A2FE975007FC79B /* MWKImageList.m in
Sources */,
D494A71819F7103D0098AA18 /* MWKTestCase.m in
Sources */,
D494A71319F70F910098AA18 /*
MWKDataStoreStorageTests.m in Sources */,
D48405D019E47572006F4139 /* MWKArticleStore.m
in Sources */,
diff --git a/MediaWikiKit/MediaWikiKit/MWKArticleStore.h
b/MediaWikiKit/MediaWikiKit/MWKArticleStore.h
index 936afc2..478507a 100644
--- a/MediaWikiKit/MediaWikiKit/MWKArticleStore.h
+++ b/MediaWikiKit/MediaWikiKit/MWKArticleStore.h
@@ -17,6 +17,7 @@
@class MWKArticle;
@class MWKSection;
@class MWKImage;
+@class MWKImageList;
@interface MWKArticleStore : NSObject
@@ -25,11 +26,11 @@
@property (readonly) MWKArticle *article;
-@property (readonly) NSArray *sections; // ?
+@property (readonly) NSArray *sections;
-(MWKSection *)sectionAtIndex:(NSUInteger)index;
-(NSString *)sectionTextAtIndex:(NSUInteger)index;
-@property (readonly) NSArray *imageURLs;
+@property (readonly) MWKImageList *imageList;
-(MWKImage *)imageWithURL:(NSString *)url;
-(NSData *)imageDataWithImage:(MWKImage *)image;
-(UIImage *)UIImageWithImage:(MWKImage *)image;
@@ -37,6 +38,8 @@
@property (readonly) MWKImage *thumbnailImage;
@property (readonly) UIImage *thumbnailUIImage;
+-(void)saveImageList;
+
@property (readwrite) BOOL needsRefresh;
-(instancetype)initWithTitle:(MWKTitle *)title dataStore:(MWKDataStore
*)dataStore;
diff --git a/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
b/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
index 0e0ef80..bc594d9 100644
--- a/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
+++ b/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
@@ -10,6 +10,7 @@
@implementation MWKArticleStore {
MWKArticle *_article;
+ MWKImageList *_imageList;
NSArray *_sections;
}
@@ -30,6 +31,7 @@
_title = title;
_dataStore = dataStore;
_article = nil;
+ _imageList = nil;
_sections = nil;
}
return self;
@@ -131,13 +133,19 @@
return [self.dataStore sectionTextWithId:index article:self.article];
}
--(NSArray *)imageURLs
+-(MWKImageList *)imageList
{
- NSMutableArray *array = [[NSMutableArray alloc] init];
-
- // @fixme implement
-
- return [NSArray arrayWithArray:array];
+ if (_imageList == nil) {
+ NSString *path = [self.dataStore pathForTitle:self.title];
+ NSString *fileName = [path
stringByAppendingPathComponent:@"Images.plist"];
+ NSDictionary *dict = [NSDictionary
dictionaryWithContentsOfFile:fileName];
+ if (dict) {
+ _imageList = [[MWKImageList alloc] initWithTitle:self.title
dict:dict];
+ } else {
+ _imageList = [[MWKImageList alloc] initWithTitle:self.title];
+ }
+ }
+ return _imageList;
}
-(MWKImage *)imageWithURL:(NSString *)url
@@ -147,7 +155,10 @@
-(MWKImage *)importImageURL:(NSString *)url
{
- return [[MWKImage alloc] initWithTitle:self.title sourceURL:url];
+ [self.imageList addImageURL:url];
+ MWKImage *image = [[MWKImage alloc] initWithTitle:self.title
sourceURL:url];;
+ [self.dataStore saveImage:image]; // stub
+ return image;
}
-(NSData *)imageDataWithImage:(MWKImage *)image
@@ -171,6 +182,14 @@
return image;
}
+-(void)saveImageList
+{
+ NSString *path = [self.dataStore pathForTitle:self.title];
+ NSString *fileName = [path stringByAppendingPathComponent:@"Images.plist"];
+ NSDictionary *dict = [self.imageList dataExport];
+ [dict writeToFile:fileName atomically:YES];
+}
+
-(void)setNeedsRefresh:(BOOL)val
{
diff --git a/MediaWikiKit/MediaWikiKit/MWKDataStore.m
b/MediaWikiKit/MediaWikiKit/MWKDataStore.m
index ccc4df3..386155e 100644
--- a/MediaWikiKit/MediaWikiKit/MWKDataStore.m
+++ b/MediaWikiKit/MediaWikiKit/MWKDataStore.m
@@ -121,13 +121,16 @@
// "/" occurs in those nasty paths! but ":" cannot so let's use it
// just like Mac OS X does ;)
- NSString *noslashes = [suffix
stringByReplacingOccurrencesOfString:@"/" withString:@":"];
- return noslashes;
+ //NSString *noslashes = [suffix
stringByReplacingOccurrencesOfString:@"/" withString:@":"];
+
+ NSString *fileName = [suffix lastPathComponent];
+ return fileName;
} else {
@throw [NSException exceptionWithName:@"MWKDataStoreException"
reason:@"Tried to save
non-upload.wikimedia.org URL as image"
userInfo:@{@"str": str}];
}
+
}
#pragma mark - save methods
diff --git a/MediaWikiKit/MediaWikiKit/MWKImage.h
b/MediaWikiKit/MediaWikiKit/MWKImage.h
index c6c3678..992de49 100644
--- a/MediaWikiKit/MediaWikiKit/MWKImage.h
+++ b/MediaWikiKit/MediaWikiKit/MWKImage.h
@@ -38,4 +38,7 @@
-(void)updateWithData:(NSData *)data mimeType:(NSString *)mimeType;
-(void)updateLastAccessed;
++(NSString *)fileNameNoSizePrefix:(NSString *)sourceURL;
++(int)fileSizePrefix:(NSString *)sourceURL;
+
@end
diff --git a/MediaWikiKit/MediaWikiKit/MWKImage.m
b/MediaWikiKit/MediaWikiKit/MWKImage.m
index eb3dc78..635a13b 100644
--- a/MediaWikiKit/MediaWikiKit/MWKImage.m
+++ b/MediaWikiKit/MediaWikiKit/MWKImage.m
@@ -52,15 +52,33 @@
return [self.sourceURL lastPathComponent];
}
++(NSString *)fileNameNoSizePrefix:(NSString *)sourceURL
+{
+ NSString *fileName = [sourceURL lastPathComponent];
+ NSRegularExpression *re = [NSRegularExpression
regularExpressionWithPattern:@"^\\d+px-(.*)$" options:0 error:nil];
+ NSArray *matches = [re matchesInString:fileName options:0
range:NSMakeRange(0, [fileName length])];
+ if ([matches count]) {
+ return [fileName substringWithRange:[matches[0] rangeAtIndex:0]];
+ } else {
+ return fileName;
+ }
+}
+
++(int)fileSizePrefix:(NSString *)sourceURL
+{
+ NSString *fileName = [sourceURL lastPathComponent];
+ NSRegularExpression *re = [NSRegularExpression
regularExpressionWithPattern:@"^(\\d+)px-" options:0 error:nil];
+ NSArray *matches = [re matchesInString:fileName options:0
range:NSMakeRange(0, [fileName length])];
+ if ([matches count]) {
+ return [[fileName substringWithRange:[matches[0] rangeAtIndex:0]]
intValue];
+ } else {
+ return -1;
+ }
+}
+
-(NSString *)fileNameNoSizePrefix
{
- NSRegularExpression *re = [NSRegularExpression
regularExpressionWithPattern:@"^\\d+px-(.*)$" options:0 error:nil];
- NSArray *matches = [re matchesInString:self.fileName options:0
range:NSMakeRange(0, [self.fileName length])];
- if (matches) {
- return matches[1];
- } else {
- return self.fileName;
- }
+ return [MWKImage fileNameNoSizePrefix:self.sourceURL];
}
-(id)dataExport
@@ -68,10 +86,10 @@
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
dict[@"sourceURL"] = self.sourceURL;
if (self.dateLastAccessed) {
- dict[@"dateLastAccessed"] = self.dateLastAccessed;
+ dict[@"dateLastAccessed"] = [self
iso8601DateString:self.dateLastAccessed];
}
if (self.dateRetrieved) {
- dict[@"dateRetrieved"] = self.dateRetrieved;
+ dict[@"dateRetrieved"] = [self iso8601DateString:self.dateRetrieved];
}
if (self.mimeType) {
dict[@"mimeType"] = self.mimeType;
diff --git a/MediaWikiKit/MediaWikiKit/MWKImageList.h
b/MediaWikiKit/MediaWikiKit/MWKImageList.h
new file mode 100644
index 0000000..9dcda99
--- /dev/null
+++ b/MediaWikiKit/MediaWikiKit/MWKImageList.h
@@ -0,0 +1,26 @@
+//
+// MWKImageList.h
+// MediaWikiKit
+//
+// Created by Brion on 12/3/14.
+// Copyright (c) 2014 Wikimedia Foundation. All rights reserved.
+//
+
+#import "MWKSiteDataObject.h"
+
+@interface MWKImageList : MWKSiteDataObject
+
+@property (readonly) MWKTitle *title;
+@property (readonly) NSUInteger length;
+
+-(instancetype)initWithTitle:(MWKTitle *)title;
+-(instancetype)initWithTitle:(MWKTitle *)title dict:(NSDictionary *)dict;
+
+-(void)addImageURL:(NSString *)imageURL;
+
+-(NSString *)imageURLAtIndex:(NSUInteger)index;
+-(BOOL)hasImageURL:(NSString *)imageURL;
+-(NSUInteger)indexOfImageURL:(NSString *)url;
+-(NSString *)largestImageVariant:(NSString *)image;
+
+@end
diff --git a/MediaWikiKit/MediaWikiKit/MWKImageList.m
b/MediaWikiKit/MediaWikiKit/MWKImageList.m
new file mode 100644
index 0000000..120611e
--- /dev/null
+++ b/MediaWikiKit/MediaWikiKit/MWKImageList.m
@@ -0,0 +1,96 @@
+//
+// MWKImageList.m
+// MediaWikiKit
+//
+// Created by Brion on 12/3/14.
+// Copyright (c) 2014 Wikimedia Foundation. All rights reserved.
+//
+
+#import "MediaWikiKit.h"
+
+@implementation MWKImageList {
+ NSMutableArray *entries;
+ NSMutableDictionary *entriesByURL;
+ NSMutableDictionary *entriesByNameWithoutSize;
+}
+
+-(void)addImageURL:(NSString *)imageURL
+{
+ [entries addObject:imageURL];
+ entriesByURL[imageURL] = imageURL;
+
+ NSString *key = [MWKImage fileNameNoSizePrefix:imageURL];
+ NSMutableArray *byname = entriesByNameWithoutSize[key];
+ if (byname == nil) {
+ byname = [[NSMutableArray alloc] init];
+ entriesByNameWithoutSize[key] = byname;
+ }
+ [byname addObject:imageURL];
+}
+
+-(NSString *)imageURLAtIndex:(NSUInteger)index
+{
+ return entries[index];
+}
+
+-(BOOL)hasImageURL:(NSString *)imageURL
+{
+ return (entriesByURL[imageURL] != nil);
+}
+
+-(NSUInteger)indexOfImage:(NSString *)imageURL
+{
+ return [entries indexOfObject:imageURL];
+}
+
+-(NSString *)largestImageVariant:(NSString *)imageURL
+{
+ NSString *baseName = [MWKImage fileNameNoSizePrefix:imageURL];
+ NSMutableArray *arr = entriesByNameWithoutSize[baseName];
+
+ int width = -1, biggestWidth = -1;
+ NSString *biggestURL = imageURL;
+ if (arr) {
+ for (NSString *sourceURL in arr) {
+ NSString *fileName = [sourceURL lastPathComponent];
+ int width = [MWKImage fileSizePrefix:fileName];
+ if (width > biggestWidth) {
+ biggestWidth = width;
+ biggestURL = sourceURL;
+ }
+ }
+ }
+ return biggestURL;
+}
+
+#pragma mark - data i/o
+
+-(instancetype)initWithTitle:(MWKTitle *)title
+{
+ self = [self initWithSite:title.site];
+ if (self) {
+ _title = title;
+ entries = [[NSMutableArray alloc] init];
+ entriesByURL = [[NSMutableDictionary alloc] init];
+ entriesByNameWithoutSize = [[NSMutableDictionary alloc] init];
+ }
+ return self;
+}
+
+-(instancetype)initWithTitle:(MWKTitle *)title dict:(NSDictionary *)dict
+{
+ self = [self initWithTitle:title];
+ if (self) {
+ for (NSString *url in dict[@"entries"]) {
+ [self addImageURL:url];
+ }
+ }
+ return self;
+}
+
+-(id)dataExport
+{
+ return @{@"entries": [NSArray arrayWithArray:entries]};
+}
+
+@end
diff --git a/MediaWikiKit/MediaWikiKit/MediaWikiKit.h
b/MediaWikiKit/MediaWikiKit/MediaWikiKit.h
index c4a0fee..8e6895b 100644
--- a/MediaWikiKit/MediaWikiKit/MediaWikiKit.h
+++ b/MediaWikiKit/MediaWikiKit/MediaWikiKit.h
@@ -31,6 +31,8 @@
#import "MWKRecentSearchEntry.h"
#import "MWKRecentSearchList.h"
+#import "MWKImageList.h"
+
#import "MWKDataStore.h"
#import "MWKArticleStore.h"
#import "MWKUserDataStore.h"
diff --git a/wikipedia/Networking/Fetchers/ArticleFetcher.m
b/wikipedia/Networking/Fetchers/ArticleFetcher.m
index 2acd387..56b14d8 100644
--- a/wikipedia/Networking/Fetchers/ArticleFetcher.m
+++ b/wikipedia/Networking/Fetchers/ArticleFetcher.m
@@ -89,7 +89,10 @@
[self.articleStore importMobileViewJSON:responseObject];
//[self applyResultsForLeadSection:leadSectionResults];
- [self createImageRecordsForSection:0];
+ for (int n = 0; n < [self.articleStore.sections count]; n++) {
+ [self createImageRecordsForSection:n];
+ }
+ [self.articleStore saveImageList];
[self finishWithError: nil
fetchedData: nil];
diff --git a/wikipedia/Web Image Interception/URLCache.m b/wikipedia/Web Image
Interception/URLCache.m
index 8200dd1..1be4cbd 100644
--- a/wikipedia/Web Image Interception/URLCache.m
+++ b/wikipedia/Web Image Interception/URLCache.m
@@ -8,10 +8,9 @@
#import "NSString+Extras.h"
#import "SessionSingleton.h"
-@interface URLCache (){
- //ArticleDataContextSingleton *articleDataContext_;
- MWKArticleStore *articleStore;
-}
+@interface URLCache ()
+
+@property (readonly) MWKArticleStore *articleStore;
// Reminder: When using this debugging image to test caching (i.e. seeing if
article images
// show the placeholder) be sure to quit and restart the app (double-tap the
home button
@@ -19,7 +18,7 @@
// version of the actual image it downloaded - that is, it has no need to
attempt a cache hit.
// Once the app is then restarted if everything is working the article images
should all
// show the placeholder image.
-//@property (strong, nonatomic) NSData *debuggingPlaceHolderImageData;
+@property (strong, nonatomic) NSData *debuggingPlaceHolderImageData;
@end
@@ -29,11 +28,14 @@
{
self = [super initWithMemoryCapacity:memoryCapacity
diskCapacity:diskCapacity diskPath:path];
if (self) {
- //articleDataContext_ = [ArticleDataContextSingleton sharedInstance];
- articleStore = [SessionSingleton sharedInstance].articleStore;
- //self.debuggingPlaceHolderImageData =
UIImagePNGRepresentation([UIImage imageNamed:@"logo-onboarding-subtitle.png"]);
+ self.debuggingPlaceHolderImageData = UIImagePNGRepresentation([UIImage
imageNamed:@"logo-onboarding-subtitle.png"]);
}
return self;
+}
+
+-(MWKArticleStore *)articleStore
+{
+ return [SessionSingleton sharedInstance].articleStore;
}
-(BOOL)isMIMETypeRerouted:(NSString *)type
@@ -79,7 +81,7 @@
NSData *imageDataToUse = cachedResponse.data;
- MWKImage *image = [articleStore imageWithURL:urlStr];
+ MWKImage *image = [self.articleStore imageWithURL:urlStr];
if (!image) {
// If an Image object wasn't pre-created by
:createSectionImageRecordsForSectionHtml:onContext:" then don't try to cache.
@@ -107,7 +109,7 @@
// (This one has no thread safety issues.)
//imageDataToUse = self.debuggingPlaceHolderImageData;
- [articleStore importImageData:imageDataToUse image:image
mimeType:cachedResponse.response.MIMEType];
+ [self.articleStore importImageData:imageDataToUse image:image
mimeType:cachedResponse.response.MIMEType];
// Broadcast the image data so things like the table of contents can update
// itself as images arrive.
@@ -147,7 +149,7 @@
//imageURL = [imageURL getUrlWithoutScheme];
//Image *imageFromDB = (Image *)[articleDataContext_.mainContext
getEntityForName: @"Image" withPredicateFormat:@"sourceUrl == %@", imageURL];
- MWKImage *imageFromDB = [articleStore imageWithURL:imageURL];
+ MWKImage *imageFromDB = [self.articleStore imageWithURL:imageURL];
// If a core data Image was found, but its data length is zero, the Image
record was probably
// created when the section html was parsed to create sectionImage
records, in which case
@@ -156,7 +158,7 @@
if (imageFromDB && !imageFromDB.dateRetrieved) {
cachedResponse = nil;
}else if (imageFromDB) {
- NSData *imageData = [articleStore imageDataWithImage:imageFromDB];
+ NSData *imageData = [self.articleStore imageDataWithImage:imageFromDB];
//NSLog(@"CACHED IMAGE FOUND!!!!!! requestURL = %@", imageURL);
NSURLResponse *response = [[NSURLResponse alloc]
initWithURL:requestURL MIMEType:imageFromDB.mimeType
expectedContentLength:imageData.length textEncodingName:nil];
cachedResponse = [[NSCachedURLResponse alloc]
initWithResponse:response data:imageData];
--
To view, visit https://gerrit.wikimedia.org/r/177493
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I923a7f6f2eb58d03edc9d3b7efe68c98595e9acb
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Mhurd <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits