Fixed: Fixed issue where an unknown episode/item in the queue would crash CheckQueue.

pull/4/head
kay.one 13 years ago
parent 91d3d522ec
commit 68e1a0bc4d

@ -92,6 +92,27 @@
"unpackopts":"3", "unpackopts":"3",
"verbosity":"" "verbosity":""
}, },
{
"avg_age":"580d",
"cat":"tv",
"eta":"01:45 PM Mon 23 Jan",
"filename":"Invalid Item",
"index":1,
"mb":"419.23",
"mbleft":"419.23",
"missing":0,
"msgid":5657628,
"nzo_id":"SABnzbd_nzo_dgrzts",
"percentage":"0",
"priority":"Normal",
"script":"None",
"size":"419 MB",
"sizeleft":"419 MB",
"status":"Queued",
"timeleft":"86:01:55",
"unpackopts":"3",
"verbosity":""
},
{ {
"status":"Paused", "status":"Paused",
"index":1, "index":1,

@ -94,7 +94,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SabProviderTests
var result = Mocker.Resolve<SabProvider>().GetQueue(); var result = Mocker.Resolve<SabProvider>().GetQueue();
result.Should().HaveCount(3); result.Should().HaveCount(4);
} }
[Test] [Test]
@ -209,6 +209,12 @@ namespace NzbDrone.Core.Test.ProviderTests.SabProviderTests
result.Should().BeFalse(); result.Should().BeFalse();
} }
[TearDown]
public void TearDown()
{
ExceptionVerification.IgnoreWarns();
}
} }
} }

@ -75,7 +75,7 @@ namespace NzbDrone.Core.Providers
public virtual bool IsInQueue(EpisodeParseResult newParseResult) public virtual bool IsInQueue(EpisodeParseResult newParseResult)
{ {
var queue = GetQueue(); var queue = GetQueue().Where(c => c.ParseResult != null);
return queue.Any(sabQueueItem => String.Equals(sabQueueItem.ParseResult.CleanTitle, newParseResult.Series.CleanTitle, StringComparison.InvariantCultureIgnoreCase) && return queue.Any(sabQueueItem => String.Equals(sabQueueItem.ParseResult.CleanTitle, newParseResult.Series.CleanTitle, StringComparison.InvariantCultureIgnoreCase) &&
sabQueueItem.ParseResult.EpisodeNumbers.Any(e => newParseResult.EpisodeNumbers.Contains(e)) && sabQueueItem.ParseResult.EpisodeNumbers.Any(e => newParseResult.EpisodeNumbers.Contains(e)) &&

Loading…
Cancel
Save