Fixed: Rare error when removing pending items that have been rejected

pull/3113/head
Mark McDowall 9 years ago
parent 8773d38ddd
commit 7934003b5e

@ -1,19 +1,12 @@
using System;
using System.Collections.Generic;
using FizzWare.NBuilder;
using Marr.Data;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Download.Pending;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Profiles;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
using FluentAssertions;
namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests

@ -299,12 +299,12 @@ namespace NzbDrone.Core.Download.Pending
foreach (var rejectedRelease in rejected)
{
var matching = pending.SingleOrDefault(MatchingReleasePredicate(rejectedRelease.RemoteEpisode.Release));
var matching = pending.Where(MatchingReleasePredicate(rejectedRelease.RemoteEpisode.Release));
if (matching != null)
foreach (var pendingRelease in matching)
{
_logger.Debug("Removing previously pending release, as it has now been rejected.");
Delete(matching);
Delete(pendingRelease);
}
}
}

Loading…
Cancel
Save