fix(sonarr): Fixed where requesting all seasons would only mark the latest as monitored #4496

pull/4500/head
tidusjar 3 years ago
parent 1d488e7b02
commit cfb85c23d7

@ -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.
if (!existingSeason.monitored)
{
existingSeason.monitored = true; existingSeason.monitored = true;
seriesChanges = true; seriesChanges = true;
}
// Now update the episodes that need updating // We do not need to update the episodes as marking the season as monitored will mark the episodes as monitored.
foreach (var epToUpdate in episodesToUpdate.Where(x => x.seasonNumber == season.SeasonNumber)) var seasonToUpdate = result.seasons.FirstOrDefault(x => x.seasonNumber == season.SeasonNumber);
{ seasonToUpdate.monitored = true; // Update by ref
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,

Loading…
Cancel
Save