1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-26 09:37:12 +00:00

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

This commit is contained in:
kay.one 2012-01-27 16:15:09 -08:00
parent 91d3d522ec
commit 68e1a0bc4d
3 changed files with 29 additions and 2 deletions

View file

@ -92,6 +92,27 @@
"unpackopts":"3",
"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",
"index":1,

View file

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

View file

@ -75,7 +75,7 @@ private static string GetNzbName(string urlString)
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) &&
sabQueueItem.ParseResult.EpisodeNumbers.Any(e => newParseResult.EpisodeNumbers.Contains(e)) &&