mirror of
https://github.com/lidarr/Lidarr
synced 2025-01-03 05:25:10 +00:00
Fixed: Removing pending release without blocklisting
(cherry picked from commit 0c883f78862f88ff37cd5539da4f569fbe3c93ed) Closes #4892
This commit is contained in:
parent
ed07f82218
commit
9560991327
2 changed files with 10 additions and 5 deletions
|
@ -118,6 +118,7 @@ function RemoveQueueItemModal(props: RemoveQueueItemModalProps) {
|
||||||
{
|
{
|
||||||
key: 'blocklistAndSearch',
|
key: 'blocklistAndSearch',
|
||||||
value: translate('BlocklistAndSearch'),
|
value: translate('BlocklistAndSearch'),
|
||||||
|
isDisabled: isPending,
|
||||||
hint: multipleSelected
|
hint: multipleSelected
|
||||||
? translate('BlocklistAndSearchMultipleHint')
|
? translate('BlocklistAndSearchMultipleHint')
|
||||||
: translate('BlocklistAndSearchHint'),
|
: translate('BlocklistAndSearchHint'),
|
||||||
|
@ -130,7 +131,7 @@ function RemoveQueueItemModal(props: RemoveQueueItemModalProps) {
|
||||||
: translate('BlocklistOnlyHint'),
|
: translate('BlocklistOnlyHint'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}, [multipleSelected]);
|
}, [isPending, multipleSelected]);
|
||||||
|
|
||||||
const handleRemovalMethodChange = useCallback(
|
const handleRemovalMethodChange = useCallback(
|
||||||
({ value }: { value: RemovalMethod }) => {
|
({ value }: { value: RemovalMethod }) => {
|
||||||
|
|
|
@ -71,7 +71,7 @@ public void RemoveAction(int id, bool removeFromClient = true, bool blocklist =
|
||||||
|
|
||||||
if (pendingRelease != null)
|
if (pendingRelease != null)
|
||||||
{
|
{
|
||||||
Remove(pendingRelease);
|
Remove(pendingRelease, blocklist);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ public object RemoveMany([FromBody] QueueBulkResource resource, [FromQuery] bool
|
||||||
|
|
||||||
foreach (var pendingRelease in pendingToRemove.DistinctBy(p => p.Id))
|
foreach (var pendingRelease in pendingToRemove.DistinctBy(p => p.Id))
|
||||||
{
|
{
|
||||||
Remove(pendingRelease);
|
Remove(pendingRelease, blocklist);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var trackedDownload in trackedToRemove.DistinctBy(t => t.DownloadItem.DownloadId))
|
foreach (var trackedDownload in trackedToRemove.DistinctBy(t => t.DownloadItem.DownloadId))
|
||||||
|
@ -263,9 +263,13 @@ public PagingResource<QueueResource> GetQueue([FromQuery] PagingRequestResource
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Remove(NzbDrone.Core.Queue.Queue pendingRelease)
|
private void Remove(NzbDrone.Core.Queue.Queue pendingRelease, bool blocklist)
|
||||||
|
{
|
||||||
|
if (blocklist)
|
||||||
{
|
{
|
||||||
_blocklistService.Block(pendingRelease.RemoteAlbum, "Pending release manually blocklisted");
|
_blocklistService.Block(pendingRelease.RemoteAlbum, "Pending release manually blocklisted");
|
||||||
|
}
|
||||||
|
|
||||||
_pendingReleaseService.RemovePendingQueueItems(pendingRelease.Id);
|
_pendingReleaseService.RemovePendingQueueItems(pendingRelease.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue