mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-17 10:45:49 +02:00
Fixed: CDH can now remove items after import from NzbGet it didn't grab itself.
This commit is contained in:
parent
6095855102
commit
42f9992af0
@ -102,9 +102,22 @@ public void RemoveItem(string id, NzbgetSettings settings)
|
|||||||
var queue = GetQueue(settings);
|
var queue = GetQueue(settings);
|
||||||
var history = GetHistory(settings);
|
var history = GetHistory(settings);
|
||||||
|
|
||||||
var queueItem = queue.SingleOrDefault(h => h.Parameters.Any(p => p.Name == "drone" && id == (p.Value as string)));
|
int nzbId;
|
||||||
var historyItem = history.SingleOrDefault(h => h.Parameters.Any(p => p.Name == "drone" && id == (p.Value as string)));
|
NzbgetQueueItem queueItem;
|
||||||
|
NzbgetHistoryItem historyItem;
|
||||||
|
|
||||||
|
if (id.Length < 10 && int.TryParse(id, out nzbId))
|
||||||
|
{
|
||||||
|
// Download wasn't grabbed by Sonarr, so the id is the NzbId reported by nzbget.
|
||||||
|
queueItem = queue.SingleOrDefault(h => h.NzbId == nzbId);
|
||||||
|
historyItem = history.SingleOrDefault(h => h.Id == nzbId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
queueItem = queue.SingleOrDefault(h => h.Parameters.Any(p => p.Name == "drone" && id == (p.Value as string)));
|
||||||
|
historyItem = history.SingleOrDefault(h => h.Parameters.Any(p => p.Name == "drone" && id == (p.Value as string)));
|
||||||
|
}
|
||||||
|
|
||||||
if (queueItem != null)
|
if (queueItem != null)
|
||||||
{
|
{
|
||||||
if (!EditQueue("GroupFinalDelete", 0, "", queueItem.NzbId, settings))
|
if (!EditQueue("GroupFinalDelete", 0, "", queueItem.NzbId, settings))
|
||||||
|
Loading…
Reference in New Issue
Block a user