Skip to content

Commit 5ff8479

Browse files
committed
Add new parameter for including linked but not uploaded episodes
1 parent 73fc755 commit 5ff8479

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

library/src/main/java/me/proxer/library/api/info/EpisodeInfoEndpoint.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ public final class EpisodeInfoEndpoint implements PagingLimitEndpoint<EpisodeInf
3535
@Setter(onMethod = @__({@Override}))
3636
private Integer limit;
3737

38+
/**
39+
* Sets if episodes should be included which are linked, but not uploaded yet.
40+
*/
41+
@Nullable
42+
@Setter
43+
private Boolean includeNotAvailableEpisodes;
44+
3845
EpisodeInfoEndpoint(final InternalApi internalApi, final String id) {
3946
this.internalApi = internalApi;
4047
this.id = id;
@@ -45,6 +52,6 @@ public final class EpisodeInfoEndpoint implements PagingLimitEndpoint<EpisodeInf
4552
*/
4653
@Override
4754
public ProxerCall<EpisodeInfo> build() {
48-
return internalApi.episodeInfo(id, page, limit);
55+
return internalApi.episodeInfo(id, page, limit, includeNotAvailableEpisodes);
4956
}
5057
}

library/src/main/java/me/proxer/library/api/info/InternalApi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ interface InternalApi {
3636
@GET("info/listinfo")
3737
ProxerCall<EpisodeInfo> episodeInfo(@Query("id") String id,
3838
@Query("p") Integer page,
39-
@Query("limit") Integer limit);
39+
@Query("limit") Integer limit,
40+
@Query("includeNotAvailableChapters") Boolean includeNotAvailableChapters);
4041

4142
@GET("info/comments")
4243
ProxerCall<List<Comment>> comments(@Query("id") String id,

library/src/test/java/me/proxer/library/api/info/EpisodeInfoEndpointTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ public void testPath() throws ProxerException, IOException, InterruptedException
5353
api.info().episodeInfo("17")
5454
.page(0)
5555
.limit(10)
56+
.includeNotAvailableEpisodes(true)
5657
.build()
5758
.execute();
5859

59-
assertThat(server.takeRequest().getPath()).isEqualTo("/api/v1/info/listinfo?id=17&p=0&limit=10");
60+
assertThat(server.takeRequest().getPath())
61+
.isEqualTo("/api/v1/info/listinfo?id=17&p=0&limit=10&includeNotAvailableChapters=true");
6062
}
6163

6264
private EpisodeInfo buildTestInfo() {

0 commit comments

Comments
 (0)