Fixes issue #62

This commit is contained in:
Shannon Barrett 2016-03-22 12:32:48 -05:00
parent b100fbe678
commit c9d2b8fc13
10 changed files with 73 additions and 17 deletions

View file

@ -54,7 +54,7 @@ namespace PlexRequests.Api
return obj;
}
public SonarrAddSeries AddSeries(int tvdbId, string title, int qualityId, bool seasonFolders, string rootPath, bool episodes, string apiKey, Uri baseUrl)
public SonarrAddSeries AddSeries(int tvdbId, string title, int qualityId, bool seasonFolders, string rootPath, bool episodes, int[] seasons, string apiKey, Uri baseUrl)
{
var request = new RestRequest
@ -90,6 +90,19 @@ namespace PlexRequests.Api
options.seasons = new List<Season>();
options.rootFolderPath = rootPath;
if (seasons.Length > 0)
{
foreach (int s in seasons)
{
var season = new Season
{
seasonNumber = s,
monitored = true
};
options.seasons.Add(season);
}
}
request.AddHeader("X-Api-Key", apiKey);
request.AddJsonBody(options);