jensenkd / plex-api

.NET Core SDK for Plex Media Server
MIT License
86 stars 27 forks source link

Add method on Plex.Library.ApiModels.Libraries.ShowLibrary to be able to get Seasons/Episodes of a particular show or season using the rating key #37

Closed jensenkd closed 2 years ago

jensenkd commented 2 years ago

Add method Seasons(id) and Episodes(id) to ShowLibrary

jensenkd commented 2 years ago
var library = this.fixture.Server.Libraries().Result.Single(c => c.Title == "TV Shows") as ShowLibrary;
var seasons = await library.Seasons(92640);

foreach (var season in seasons.Media)
{
     this.output.WriteLine("Season Title: " + season.Title);
     var episodes = await library.Episodes(int.Parse(season.RatingKey));

     foreach (var episode in episodes.Media)
     {
          this.output.WriteLine("Episode Title: " + episode.Title);
      }
}