|
|
@ -374,17 +374,12 @@ namespace Ombi.Core.Senders
|
|
|
|
if (sonarrEpCount == ourRequestCount /*|| !missingEpisodes.Any()*/)
|
|
|
|
if (sonarrEpCount == ourRequestCount /*|| !missingEpisodes.Any()*/)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// We have the same amount of requests as all of the episodes in the season.
|
|
|
|
// We have the same amount of requests as all of the episodes in the season.
|
|
|
|
|
|
|
|
existingSeason.monitored = true;
|
|
|
|
|
|
|
|
seriesChanges = true;
|
|
|
|
|
|
|
|
|
|
|
|
if (!existingSeason.monitored)
|
|
|
|
// We do not need to update the episodes as marking the season as monitored will mark the episodes as monitored.
|
|
|
|
{
|
|
|
|
var seasonToUpdate = result.seasons.FirstOrDefault(x => x.seasonNumber == season.SeasonNumber);
|
|
|
|
existingSeason.monitored = true;
|
|
|
|
seasonToUpdate.monitored = true; // Update by ref
|
|
|
|
seriesChanges = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Now update the episodes that need updating
|
|
|
|
|
|
|
|
foreach (var epToUpdate in episodesToUpdate.Where(x => x.seasonNumber == season.SeasonNumber))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await SonarrApi.UpdateEpisode(epToUpdate, s.ApiKey, s.FullUri);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -442,7 +437,6 @@ namespace Ombi.Core.Senders
|
|
|
|
var seasonsToUpdate = new List<Season>();
|
|
|
|
var seasonsToUpdate = new List<Season>();
|
|
|
|
for (var i = 0; i < model.ParentRequest.TotalSeasons + 1; i++)
|
|
|
|
for (var i = 0; i < model.ParentRequest.TotalSeasons + 1; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var index = i;
|
|
|
|
|
|
|
|
var sea = new Season
|
|
|
|
var sea = new Season
|
|
|
|
{
|
|
|
|
{
|
|
|
|
seasonNumber = i,
|
|
|
|
seasonNumber = i,
|
|
|
|