mirror of
https://github.com/jellyfin/TMDbLib.git
synced 2024-11-26 23:30:23 +00:00
Merge pull request #321 from FrederikBolding/missing-tv-show-methods
Added a few missing tv show methods
This commit is contained in:
commit
c64abcaef6
@ -103,6 +103,14 @@ namespace TMDbLib.Client
|
||||
return response;
|
||||
}
|
||||
|
||||
public async Task<ResultContainer<TvEpisodeInfo>> 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<ResultContainer<TvEpisodeInfo>>(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a credits object for the specified episode.
|
||||
/// </summary>
|
||||
|
@ -3,17 +3,11 @@ using System;
|
||||
|
||||
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 @@ namespace TMDbLib.Objects.TvShows
|
||||
[JsonProperty("production_code")]
|
||||
public string ProductionCode { get; set; }
|
||||
|
||||
[JsonProperty("season_number")]
|
||||
public int SeasonNumber { get; set; }
|
||||
|
||||
[JsonProperty("show_id")]
|
||||
public int ShowId { get; set; }
|
||||
|
||||
|
16
TMDbLib/Objects/TvShows/TvEpisodeInfo.cs
Normal file
16
TMDbLib/Objects/TvShows/TvEpisodeInfo.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
@ -260,5 +260,18 @@ namespace TMDbLibTests
|
||||
|
||||
Assert.Null(tvEpisode);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestTvEpisodesScreenedTheatrically()
|
||||
{
|
||||
ResultContainer<TvEpisodeInfo> 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);
|
||||
}
|
||||
}
|
||||
}
|
@ -442,6 +442,12 @@ namespace TMDbLibTests
|
||||
Assert.NotNull(tvShow);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestTvShowReviews()
|
||||
{
|
||||
TestHelpers.SearchPages(i => Config.Client.GetTvShowReviewsAsync(IdHelper.BreakingBad, page: i).Result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestTvShowLists()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user