diff --git a/TMDbLib/Client/TMDbClientTvEpisodes.cs b/TMDbLib/Client/TMDbClientTvEpisodes.cs index 1a454f5b..1fe1af7f 100644 --- a/TMDbLib/Client/TMDbClientTvEpisodes.cs +++ b/TMDbLib/Client/TMDbClientTvEpisodes.cs @@ -103,6 +103,14 @@ public partial class TMDbClient return response; } + public async Task> GetTvEpisodesScreenedTheatricallyAsync(int tvShowId, CancellationToken cancellationToken = default(CancellationToken)) + { + RestRequest req = _client.Create("tv/{tv_id}/screened_theatrically"); + req.AddUrlSegment("tv_id", tvShowId.ToString(CultureInfo.InvariantCulture)); + + return await req.ExecuteGet>(cancellationToken).ConfigureAwait(false); + } + /// /// Returns a credits object for the specified episode. /// diff --git a/TMDbLib/Objects/TvShows/TvEpisodeBase.cs b/TMDbLib/Objects/TvShows/TvEpisodeBase.cs index 255bc4fe..a970ec9f 100644 --- a/TMDbLib/Objects/TvShows/TvEpisodeBase.cs +++ b/TMDbLib/Objects/TvShows/TvEpisodeBase.cs @@ -3,17 +3,11 @@ namespace TMDbLib.Objects.TvShows { - public class TvEpisodeBase + public class TvEpisodeBase : TvEpisodeInfo { [JsonProperty("air_date")] public DateTime? AirDate { get; set; } - [JsonProperty("episode_number")] - public int EpisodeNumber { get; set; } - - [JsonProperty("id")] - public int? Id { get; set; } - [JsonProperty("name")] public string Name { get; set; } @@ -23,9 +17,6 @@ public class TvEpisodeBase [JsonProperty("production_code")] public string ProductionCode { get; set; } - [JsonProperty("season_number")] - public int SeasonNumber { get; set; } - [JsonProperty("show_id")] public int ShowId { get; set; } diff --git a/TMDbLib/Objects/TvShows/TvEpisodeInfo.cs b/TMDbLib/Objects/TvShows/TvEpisodeInfo.cs new file mode 100644 index 00000000..9b9c2e78 --- /dev/null +++ b/TMDbLib/Objects/TvShows/TvEpisodeInfo.cs @@ -0,0 +1,16 @@ +using Newtonsoft.Json; + +namespace TMDbLib.Objects.TvShows +{ + public class TvEpisodeInfo + { + [JsonProperty("id")] + public int? Id { get; set; } + + [JsonProperty("season_number")] + public int SeasonNumber { get; set; } + + [JsonProperty("episode_number")] + public int EpisodeNumber { get; set; } + } +} diff --git a/TMDbLibTests/ClientTvEpisodeTests.cs b/TMDbLibTests/ClientTvEpisodeTests.cs index a2de567a..6a761720 100644 --- a/TMDbLibTests/ClientTvEpisodeTests.cs +++ b/TMDbLibTests/ClientTvEpisodeTests.cs @@ -260,5 +260,18 @@ public void TestTvEpisodeMissing() Assert.Null(tvEpisode); } + + [Fact] + public void TestTvEpisodesScreenedTheatrically() + { + ResultContainer results = Config.Client.GetTvEpisodesScreenedTheatricallyAsync(IdHelper.GameOfThrones).Result; + + Assert.Equal(IdHelper.GameOfThrones, results.Id); + + TvEpisodeInfo single = results.Results.FirstOrDefault(s => s.Id == 63103); + Assert.NotNull(single); + Assert.Equal(4, single.SeasonNumber); + Assert.Equal(10, single.EpisodeNumber); + } } } \ No newline at end of file diff --git a/TMDbLibTests/ClientTvShowTests.cs b/TMDbLibTests/ClientTvShowTests.cs index 481d6c6d..cad0a332 100644 --- a/TMDbLibTests/ClientTvShowTests.cs +++ b/TMDbLibTests/ClientTvShowTests.cs @@ -442,6 +442,12 @@ public void TestTvShowLatest() Assert.NotNull(tvShow); } + [Fact] + public void TestTvShowReviews() + { + TestHelpers.SearchPages(i => Config.Client.GetTvShowReviewsAsync(IdHelper.BreakingBad, page: i).Result); + } + [Fact] public void TestTvShowLists() {