Mhurd has submitted this change and it was merged.

Change subject: Thumbnail fallback: if none recorded, use first image in 
section 0
......................................................................


Thumbnail fallback: if none recorded, use first image in section 0

Change-Id: Ie8de4bfe6f7279ddafa630339cf6220e4754837d
---
M MediaWikiKit/MediaWikiKit/MWKArticleStore.m
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Mhurd: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MediaWikiKit/MediaWikiKit/MWKArticleStore.m 
b/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
index 509836b..c262229 100644
--- a/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
+++ b/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
@@ -215,6 +215,10 @@
 -(MWKImage *)thumbnailImage
 {
     NSString *url = [self.imageList imageURLAtIndex:0 
sectionId:MWK_SECTIONID_THUMBNAIL];
+    if (url == nil) {
+        // No recorded thumbnail? See if there's just a first-section image 
for now.
+        url = [self.imageList imageURLAtIndex:0 sectionId:0];
+    }
     if (url) {
         return [self imageWithURL:url];
     } else {

-- 
To view, visit https://gerrit.wikimedia.org/r/177658
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie8de4bfe6f7279ddafa630339cf6220e4754837d
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

Reply via email to