1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-21 22:05:38 -04:00

New: Speed up mass deletes from Series Editor

* New: Speed up mass deletes from Series Editor

* fixup! Additional speed up using GetAllSeriesPaths vs GetAllSeries

* fixup! Tests
This commit is contained in:
Qstick
2022-12-10 14:19:10 -06:00
committed by GitHub
parent d08f33ae21
commit 356771d139
29 changed files with 290 additions and 86 deletions
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using NLog;
@@ -252,20 +252,23 @@ namespace NzbDrone.Core.Notifications
public void Handle(SeriesDeletedEvent message)
{
var deleteMessage = new SeriesDeleteMessage(message.Series, message.DeleteFiles);
foreach (var notification in _notificationFactory.OnSeriesDeleteEnabled())
foreach (var series in message.Series)
{
try
var deleteMessage = new SeriesDeleteMessage(series, message.DeleteFiles);
foreach (var notification in _notificationFactory.OnSeriesDeleteEnabled())
{
if (ShouldHandleSeries(notification.Definition, deleteMessage.Series))
try
{
notification.OnSeriesDelete(deleteMessage);
if (ShouldHandleSeries(notification.Definition, deleteMessage.Series))
{
notification.OnSeriesDelete(deleteMessage);
}
}
catch (Exception ex)
{
_logger.Warn(ex, "Unable to send OnDelete notification to: " + notification.Definition.Name);
}
}
catch (Exception ex)
{
_logger.Warn(ex, "Unable to send OnDelete notification to: " + notification.Definition.Name);
}
}
}