BearND has uploaded a new change for review. https://gerrit.wikimedia.org/r/174632
Change subject: Use continue parameter to avoid API warnings. ...................................................................... Use continue parameter to avoid API warnings. So, the server doesn't need to spit out those unnecessary warnings about new continuation syntax. This warning seems uncalled for for queries that don't provide batching. Change-Id: If9ac1a113ef99eacad412a9164257a7c054b4697 --- M wikipedia/src/main/java/org/wikipedia/PageQueryTask.java M wikipedia/src/main/java/org/wikipedia/editing/FetchSectionWikitextTask.java M wikipedia/src/main/java/org/wikipedia/interlanguage/LangLinksFetchTask.java M wikipedia/src/main/java/org/wikipedia/nearby/NearbyFetchTask.java M wikipedia/src/main/java/org/wikipedia/random/RandomArticleIdTask.java M wikipedia/src/main/java/org/wikipedia/search/TitleSearchTask.java 6 files changed, 13 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/32/174632/1 diff --git a/wikipedia/src/main/java/org/wikipedia/PageQueryTask.java b/wikipedia/src/main/java/org/wikipedia/PageQueryTask.java index 3661e27..7b51c7d 100644 --- a/wikipedia/src/main/java/org/wikipedia/PageQueryTask.java +++ b/wikipedia/src/main/java/org/wikipedia/PageQueryTask.java @@ -23,7 +23,9 @@ @Override public RequestBuilder buildRequest(Api api) { - RequestBuilder builder = api.action("query").param("titles", TextUtils.join("|", titles)); + RequestBuilder builder = api.action("query") + .param("titles", TextUtils.join("|", titles)) + .param("continue", ""); // to avoid warning about new continuation syntax buildQueryParams(builder); return builder; } diff --git a/wikipedia/src/main/java/org/wikipedia/editing/FetchSectionWikitextTask.java b/wikipedia/src/main/java/org/wikipedia/editing/FetchSectionWikitextTask.java index ed329e3..a5dd191 100644 --- a/wikipedia/src/main/java/org/wikipedia/editing/FetchSectionWikitextTask.java +++ b/wikipedia/src/main/java/org/wikipedia/editing/FetchSectionWikitextTask.java @@ -12,7 +12,6 @@ public class FetchSectionWikitextTask extends ApiTask<String> { private final PageTitle title; private final int sectionID; - private final WikipediaApp app; public FetchSectionWikitextTask(Context context, PageTitle title, int sectionID) { super( @@ -21,7 +20,6 @@ ); this.title = title; this.sectionID = sectionID; - this.app = (WikipediaApp)context.getApplicationContext(); } @Override @@ -39,7 +37,7 @@ JSONObject pagesJSON = result.asObject() .optJSONObject("query") .optJSONObject("pages"); - String pageId = (String) pagesJSON.keys().next(); + String pageId = pagesJSON.keys().next(); JSONObject revisionJSON = pagesJSON.optJSONObject(pageId).optJSONArray("revisions").getJSONObject(0); diff --git a/wikipedia/src/main/java/org/wikipedia/interlanguage/LangLinksFetchTask.java b/wikipedia/src/main/java/org/wikipedia/interlanguage/LangLinksFetchTask.java index 98ab53d..5c86a4d 100644 --- a/wikipedia/src/main/java/org/wikipedia/interlanguage/LangLinksFetchTask.java +++ b/wikipedia/src/main/java/org/wikipedia/interlanguage/LangLinksFetchTask.java @@ -15,14 +15,12 @@ public class LangLinksFetchTask extends ApiTask<ArrayList<PageTitle>> { private final PageTitle title; - private final WikipediaApp app; public LangLinksFetchTask(Context context, PageTitle title) { super( SINGLE_THREAD, ((WikipediaApp)context.getApplicationContext()).getAPIForSite(title.getSite()) ); this.title = title; - this.app = (WikipediaApp)context.getApplicationContext(); } @Override @@ -30,7 +28,8 @@ return api.action("query") .param("prop", "langlinks") .param("titles", title.getPrefixedText()) - .param("lllimit", "500"); + .param("lllimit", "500") + .param("continue", ""); // to avoid warning about new continuation syntax } @Override @@ -39,7 +38,7 @@ JSONObject pagesJSON = result.asObject() .optJSONObject("query") .optJSONObject("pages"); - String pageId = (String) pagesJSON.keys().next(); + String pageId = pagesJSON.keys().next(); if (!pagesJSON.optJSONObject(pageId).has("langlinks")) { // No links found return linkTitles; diff --git a/wikipedia/src/main/java/org/wikipedia/nearby/NearbyFetchTask.java b/wikipedia/src/main/java/org/wikipedia/nearby/NearbyFetchTask.java index c931614..ab0ed59 100644 --- a/wikipedia/src/main/java/org/wikipedia/nearby/NearbyFetchTask.java +++ b/wikipedia/src/main/java/org/wikipedia/nearby/NearbyFetchTask.java @@ -46,7 +46,8 @@ .param("ggscoord", locationParam(location)) .param("ggsradius", RADIUS) .param("ggslimit", LIMIT) - .param("format", "json"); + .param("format", "json") + .param("continue", ""); // to avoid warning about new continuation syntax } private String locationParam(Location location) { diff --git a/wikipedia/src/main/java/org/wikipedia/random/RandomArticleIdTask.java b/wikipedia/src/main/java/org/wikipedia/random/RandomArticleIdTask.java index 20b0fac..b33f639 100644 --- a/wikipedia/src/main/java/org/wikipedia/random/RandomArticleIdTask.java +++ b/wikipedia/src/main/java/org/wikipedia/random/RandomArticleIdTask.java @@ -11,14 +11,11 @@ import org.wikipedia.Site; public class RandomArticleIdTask extends ApiTask<PageTitle> { - - private Context ctx; private Site site; public RandomArticleIdTask(Api api, Site site, Context context) { super(SINGLE_THREAD, api); this.site = site; - this.ctx = context; } @Override @@ -26,7 +23,8 @@ return api.action("query") .param("list", "random") .param("rnnamespace", "0") - .param("rnlimit", "1"); // maybe we grab 10 in the future and persist it somewhere + .param("rnlimit", "1") // maybe we grab 10 in the future and persist it somewhere + .param("continue", ""); // to avoid warning about new continuation syntax } @Override diff --git a/wikipedia/src/main/java/org/wikipedia/search/TitleSearchTask.java b/wikipedia/src/main/java/org/wikipedia/search/TitleSearchTask.java index 7322082..11b65e8 100644 --- a/wikipedia/src/main/java/org/wikipedia/search/TitleSearchTask.java +++ b/wikipedia/src/main/java/org/wikipedia/search/TitleSearchTask.java @@ -40,7 +40,8 @@ .param("pilimit", NUM_RESULTS_PER_QUERY) .param("list", "prefixsearch") .param("pssearch", prefix) - .param("pslimit", NUM_RESULTS_PER_QUERY); + .param("pslimit", NUM_RESULTS_PER_QUERY) + .param("continue", ""); // to avoid warning about new continuation syntax } @Override -- To view, visit https://gerrit.wikimedia.org/r/174632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If9ac1a113ef99eacad412a9164257a7c054b4697 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: BearND <bsitzm...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits