jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/376056 )

Change subject: Improve fetching of Main Page title from packs.
......................................................................


Improve fetching of Main Page title from packs.

Bug: T175032
Change-Id: I321346f642adb903caec43c65a11678f9d260800
---
M app/src/main/java/org/wikipedia/offline/OfflineManager.java
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/app/src/main/java/org/wikipedia/offline/OfflineManager.java 
b/app/src/main/java/org/wikipedia/offline/OfflineManager.java
index de9a46d..9dcc6c8 100644
--- a/app/src/main/java/org/wikipedia/offline/OfflineManager.java
+++ b/app/src/main/java/org/wikipedia/offline/OfflineManager.java
@@ -172,8 +172,11 @@
     }
 
     @NonNull public String getMainPageTitle(@NonNull Compilation compilation) 
throws IOException {
+        // The compilation parameter can be a "remote" compilation (i.e. 
nonempty URI but empty
+        // path, or a local compilation unmarshalled from an Intent (i.e. 
empty URI but nonempty
+        // path), so let's match our known compilations on both of these 
fields.
         for (Compilation c : compilations) {
-            if (c.pathNameMatchesUri(compilation.uri())) {
+            if (c.pathNameMatchesUri(compilation.uri()) || 
c.path().equals(compilation.path())) {
                 return c.getMainPageTitle();
             }
         }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I321346f642adb903caec43c65a11678f9d260800
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Cooltey <[email protected]>
Gerrit-Reviewer: Mholloway <[email protected]>
Gerrit-Reviewer: Sharvaniharan <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to