Skip to content

Commit 6da9b35

Browse files
committed
Support getting watch providers for a specific season
1 parent fafbed9 commit 6da9b35

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
## Next version
44

5-
* Add TV season translations method by @laurentblue in https://github.com/UweTrottmann/tmdb-java/pull/108
6-
* Add Watch Providers service with methods for movies and TV shows.
5+
* Add `TvSeasonsService.translations` by @laurentblue in https://github.com/UweTrottmann/tmdb-java/pull/108
6+
* Add `TvSeasonsService.watchProviders` to get watch providers for a specific season
7+
* Add `Tmdb.watchProvidersService` to get all available watch providers for movies and TV shows in a region
78

89
## 2.12.0 - 2025-08-08
910

src/main/java/com/uwetrottmann/tmdb2/services/TvSeasonsService.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
import com.uwetrottmann.tmdb2.entities.TvSeason;
1414
import com.uwetrottmann.tmdb2.entities.TvSeasonExternalIds;
1515
import com.uwetrottmann.tmdb2.entities.Videos;
16+
import com.uwetrottmann.tmdb2.entities.WatchProviders;
17+
import java.util.Map;
1618
import retrofit2.Call;
1719
import retrofit2.http.GET;
1820
import retrofit2.http.Path;
1921
import retrofit2.http.Query;
2022
import retrofit2.http.QueryMap;
2123

22-
import java.util.Map;
23-
2424
public interface TvSeasonsService {
2525

2626
/**
@@ -173,5 +173,12 @@ Call<Videos> videos(
173173
@Query("language") String language
174174
);
175175

176-
176+
/**
177+
* See <a href="https://developer.themoviedb.org/reference/tv-season-watch-providers">Watch Providers</a>.
178+
*/
179+
@GET("tv/{tv_id}/season/{season_number}/watch/providers")
180+
Call<WatchProviders> watchProviders(
181+
@Path("tv_id") int tvShowId,
182+
@Path("season_number") int tvShowSeasonNumber
183+
);
177184
}

src/test/java/com/uwetrottmann/tmdb2/services/TvSeasonsServiceTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import static com.uwetrottmann.tmdb2.assertions.GenericAssertions.assertImages;
1313
import static com.uwetrottmann.tmdb2.assertions.GenericAssertions.assertTranslations;
1414
import static com.uwetrottmann.tmdb2.assertions.GenericAssertions.assertVideos;
15+
import static com.uwetrottmann.tmdb2.assertions.GenericAssertions.assertWatchProviders;
1516
import static com.uwetrottmann.tmdb2.assertions.TvAssertions.assertTvSeason;
1617
import static com.uwetrottmann.tmdb2.assertions.TvAssertions.assertTvSeasonDataIntegrity;
1718
import static org.assertj.core.api.Assertions.assertThat;
@@ -27,6 +28,7 @@
2728
import com.uwetrottmann.tmdb2.entities.TvSeason;
2829
import com.uwetrottmann.tmdb2.entities.TvSeasonExternalIds;
2930
import com.uwetrottmann.tmdb2.entities.Videos;
31+
import com.uwetrottmann.tmdb2.entities.WatchProviders;
3032
import com.uwetrottmann.tmdb2.enumerations.AppendToResponseItem;
3133
import java.io.IOException;
3234
import org.junit.Test;
@@ -151,4 +153,17 @@ public void test_videos() throws IOException {
151153
assertVideos(videos);
152154
}
153155

156+
@Test
157+
public void watchProviders() throws IOException {
158+
WatchProviders providers = getUnauthenticatedInstance()
159+
.tvSeasonsService()
160+
.watchProviders(testTvShow.id, testTvSeason.season_number)
161+
.execute()
162+
.body();
163+
164+
assertThat(providers).isNotNull();
165+
assertThat(providers.id).isEqualTo(testTvSeason.id);
166+
assertWatchProviders(providers);
167+
}
168+
154169
}

0 commit comments

Comments
 (0)