diff options
author | andrewrasch <raschykid@gmail.com> | 2021-09-22 03:01:17 +0000 |
---|---|---|
committer | andrewrasch <raschykid@gmail.com> | 2021-09-22 03:01:17 +0000 |
commit | 5cfe8a601645383d0068f9acded1e99aa5f28459 (patch) | |
tree | 911044978b9591cfae6f267bfbe760d6c952c060 /app/src/main | |
parent | d6c3bfddd713b064e545461238978d3fa6c9941e (diff) | |
download | infinity-for-reddit-5cfe8a601645383d0068f9acded1e99aa5f28459.tar infinity-for-reddit-5cfe8a601645383d0068f9acded1e99aa5f28459.tar.gz infinity-for-reddit-5cfe8a601645383d0068f9acded1e99aa5f28459.tar.bz2 infinity-for-reddit-5cfe8a601645383d0068f9acded1e99aa5f28459.tar.lz infinity-for-reddit-5cfe8a601645383d0068f9acded1e99aa5f28459.tar.xz infinity-for-reddit-5cfe8a601645383d0068f9acded1e99aa5f28459.tar.zst infinity-for-reddit-5cfe8a601645383d0068f9acded1e99aa5f28459.zip |
Added API call for generic wiki page.
Updated old wiki-only call to cascade to new generic.
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/activities/WikiActivity.java | 1 | ||||
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/WikiActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/WikiActivity.java index f4cc17fa..b6fc29af 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/WikiActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/WikiActivity.java @@ -71,6 +71,7 @@ import retrofit2.Retrofit; public class WikiActivity extends BaseActivity { public static final String EXTRA_SUBREDDIT_NAME = "ESN"; + public static final String WIKI_PATH = "WP"; private static final String WIKI_MARKDOWN_STATE = "WMS"; @BindView(R.id.coordinator_layout_comment_wiki_activity) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java b/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java index 91b96c70..a7c67893 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java @@ -294,8 +294,12 @@ public interface RedditAPI { @GET("/api/trending_searches_v1.json?withAds=0&raw_json=1&gilding_detail=1") Call<String> getTrendingSearches(@HeaderMap Map<String, String> headers); - @GET("/r/{subredditName}/wiki/index.json?raw_json=1") - Call<String> getWiki(@Path("subredditName") String subredditName); + default Call<String> getWiki(@Path("subredditName") String subredditName) { + return getWikiPage(subredditName, "index"); + }; + + @GET("/r/{subredditName}/wiki/{wikiPage}.json?raw_json=1") + Call<String> getWikiPage(@Path("subredditName") String subredditName, @Path("wikiPage") String wikiPage); @GET("{sortType}?raw_json=1") ListenableFuture<Response<String>> getBestPostsListenableFuture(@Path("sortType") String sortType, @Query("after") String lastItem, @HeaderMap Map<String, String> headers); |