Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

## Next version

* Add TV season translations method by @laurentblue in https://github.com/UweTrottmann/tmdb-java/pull/108
* Add Watch Providers service with methods for movies and TV shows.
* Add `TvSeasonsService.translations` by @laurentblue in https://github.com/UweTrottmann/tmdb-java/pull/108
* Add `TvSeasonsService.watchProviders` to get watch providers for a specific season
* Add `Tmdb.watchProvidersService` to get all available watch providers for movies and TV shows in a region
* Note: TMDB has added additional primary translation languages: Bangla (India, `bn-IN`), Nepali (Nepal, `ne-NP`) and
Occitan (France, `oc-FR`).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
import com.uwetrottmann.tmdb2.entities.TvSeason;
import com.uwetrottmann.tmdb2.entities.TvSeasonExternalIds;
import com.uwetrottmann.tmdb2.entities.Videos;
import com.uwetrottmann.tmdb2.entities.WatchProviders;
import java.util.Map;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

import java.util.Map;

public interface TvSeasonsService {

/**
Expand Down Expand Up @@ -173,5 +173,12 @@ Call<Videos> videos(
@Query("language") String language
);


/**
* See <a href="https://developer.themoviedb.org/reference/tv-season-watch-providers">Watch Providers</a>.
*/
@GET("tv/{tv_id}/season/{season_number}/watch/providers")
Call<WatchProviders> watchProviders(
@Path("tv_id") int tvShowId,
@Path("season_number") int tvShowSeasonNumber
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static com.uwetrottmann.tmdb2.assertions.GenericAssertions.assertImages;
import static com.uwetrottmann.tmdb2.assertions.GenericAssertions.assertTranslations;
import static com.uwetrottmann.tmdb2.assertions.GenericAssertions.assertVideos;
import static com.uwetrottmann.tmdb2.assertions.GenericAssertions.assertWatchProviders;
import static com.uwetrottmann.tmdb2.assertions.TvAssertions.assertTvSeason;
import static com.uwetrottmann.tmdb2.assertions.TvAssertions.assertTvSeasonDataIntegrity;
import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -27,6 +28,7 @@
import com.uwetrottmann.tmdb2.entities.TvSeason;
import com.uwetrottmann.tmdb2.entities.TvSeasonExternalIds;
import com.uwetrottmann.tmdb2.entities.Videos;
import com.uwetrottmann.tmdb2.entities.WatchProviders;
import com.uwetrottmann.tmdb2.enumerations.AppendToResponseItem;
import java.io.IOException;
import org.junit.Test;
Expand Down Expand Up @@ -151,4 +153,17 @@ public void test_videos() throws IOException {
assertVideos(videos);
}

@Test
public void watchProviders() throws IOException {
WatchProviders providers = getUnauthenticatedInstance()
.tvSeasonsService()
.watchProviders(testTvShow.id, testTvSeason.season_number)
.execute()
.body();

assertThat(providers).isNotNull();
assertThat(providers.id).isEqualTo(testTvSeason.id);
assertWatchProviders(providers);
}

}
Loading