Skip to content

Commit 371b82a

Browse files
Kevin JensenKevin Jensen
authored andcommitted
Merge branch 'master' of https://github.com/jensenkd/plex-api
2 parents dff491e + 4fd15f8 commit 371b82a

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

Source/Plex.ServerApi/PlexModels/Media/Metadata.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,18 @@ public class Metadata
8383
[JsonPropertyName("audienceRating")]
8484
public double AudienceRating { get; set; }
8585

86+
[JsonPropertyName("leafCount")]
87+
public int LeafCount { get; set; }
88+
89+
[JsonPropertyName("childCount")]
90+
public int ChildCount { get; set; }
91+
8692
[JsonPropertyName("viewCount")]
8793
public int ViewCount { get; set; }
8894

95+
[JsonPropertyName("viewedLeafCount")]
96+
public int ViewedLeafCount { get; set; }
97+
8998
[JsonPropertyName("lastViewedAt")]
9099
public long LastViewedAt { get; set; }
91100

Tests/Plex.ServerApi.Test/Tests/TvLibraryTest.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,29 @@ public TvLibraryTest(ITestOutputHelper output, PlexFixture fixture)
1616
this.fixture = fixture;
1717
}
1818

19+
[Fact]
20+
public async System.Threading.Tasks.Task Test_GetShows()
21+
{
22+
var library = this.fixture.Server.Libraries().Result.Single(c => c.Title == "TV Shows") as ShowLibrary;
23+
Assert.NotNull(library);
24+
25+
26+
var shows = await library.AllShows("");
27+
Assert.NotNull(shows);
28+
Assert.True(shows.Media.Count > 0);
29+
30+
var show = shows.Media.First();
31+
Assert.NotNull(show);
32+
33+
Assert.True(show.ChildCount > 0);
34+
Assert.True(show.LeafCount > 0);
35+
if (show.ViewCount > 0)
36+
{
37+
Assert.True(show.ViewedLeafCount > 0);
38+
}
39+
}
40+
41+
1942
[Fact]
2043
public async System.Threading.Tasks.Task Test_GetSeasonsForShow()
2144
{

0 commit comments

Comments
 (0)