Potential work around for #587

pull/597/head
tidusjar 8 years ago
parent 73b50ee063
commit b7c47035dd

@ -117,6 +117,29 @@ namespace PlexRequests.UI.Helpers
return addResult; return addResult;
} }
if (requestAll ?? false)
{
//// Monitor all seasons
//foreach (var season in series.seasons)
//{
// season.monitored = true;
//}
//SonarrApi.UpdateSeries(series, sonarrSettings.ApiKey, sonarrSettings.FullUri);
//SonarrApi.SearchForSeries(series.id, sonarrSettings.ApiKey, sonarrSettings.FullUri); // Search For all episodes!"
// This is a work around for this issue: https://github.com/Sonarr/Sonarr/issues/1507
// The above is the previous code.
SonarrApi.AddSeries(model.ProviderId, model.Title, qualityProfile,
sonarrSettings.SeasonFolders, sonarrSettings.RootPath, 0, model.SeasonList, sonarrSettings.ApiKey,
sonarrSettings.FullUri, true, true);
return new SonarrAddSeries { title = series.title }; // We have updated it
}
// Series exists, don't need to add it // Series exists, don't need to add it
if (series == null) if (series == null)
{ {
@ -130,19 +153,6 @@ namespace PlexRequests.UI.Helpers
series = await GetSonarrSeries(sonarrSettings, model.ProviderId); series = await GetSonarrSeries(sonarrSettings, model.ProviderId);
} }
if (requestAll ?? false)
{
// Monitor all seasons
foreach (var season in series.seasons)
{
season.monitored = true;
}
SonarrApi.UpdateSeries(series, sonarrSettings.ApiKey, sonarrSettings.FullUri);
SonarrApi.SearchForSeries(series.id, sonarrSettings.ApiKey, sonarrSettings.FullUri); // Search For all episodes!"
return new SonarrAddSeries { title = series.title }; // We have updated it
}
if (first ?? false) if (first ?? false)
{ {
var firstSeries = (series?.seasons?.OrderBy(x => x.seasonNumber)).FirstOrDefault(x => x.seasonNumber > 0) ?? new Season(); var firstSeries = (series?.seasons?.OrderBy(x => x.seasonNumber)).FirstOrDefault(x => x.seasonNumber > 0) ?? new Season();

Loading…
Cancel
Save