1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-21 23:32:27 +00:00

Fixed: Removing pending release without blocklisting

(cherry picked from commit 0c883f78862f88ff37cd5539da4f569fbe3c93ed)

Closes #4892
This commit is contained in:
Bogdan 2024-07-08 22:25:26 +03:00
parent ed07f82218
commit 9560991327
2 changed files with 10 additions and 5 deletions

View file

@ -118,6 +118,7 @@ function RemoveQueueItemModal(props: RemoveQueueItemModalProps) {
{
key: 'blocklistAndSearch',
value: translate('BlocklistAndSearch'),
isDisabled: isPending,
hint: multipleSelected
? translate('BlocklistAndSearchMultipleHint')
: translate('BlocklistAndSearchHint'),
@ -130,7 +131,7 @@ function RemoveQueueItemModal(props: RemoveQueueItemModalProps) {
: translate('BlocklistOnlyHint'),
},
];
}, [multipleSelected]);
}, [isPending, multipleSelected]);
const handleRemovalMethodChange = useCallback(
({ value }: { value: RemovalMethod }) => {

View file

@ -71,7 +71,7 @@ public void RemoveAction(int id, bool removeFromClient = true, bool blocklist =
if (pendingRelease != null)
{
Remove(pendingRelease);
Remove(pendingRelease, blocklist);
return;
}
@ -114,7 +114,7 @@ public object RemoveMany([FromBody] QueueBulkResource resource, [FromQuery] bool
foreach (var pendingRelease in pendingToRemove.DistinctBy(p => p.Id))
{
Remove(pendingRelease);
Remove(pendingRelease, blocklist);
}
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)
{
_blocklistService.Block(pendingRelease.RemoteAlbum, "Pending release manually blocklisted");
if (blocklist)
{
_blocklistService.Block(pendingRelease.RemoteAlbum, "Pending release manually blocklisted");
}
_pendingReleaseService.RemovePendingQueueItems(pendingRelease.Id);
}