Change Recycle Bin to Handle ArtistDeleteEvent

Ensures track files are deleted when requested on an artist delete event
This commit is contained in:
Qstick 2017-09-25 21:15:10 -04:00
parent 9be4ec4c15
commit 4358184b78
1 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using NLog;
using NzbDrone.Common.Disk;
@ -8,7 +8,7 @@ using NzbDrone.Core.Configuration;
using NzbDrone.Core.MediaFiles.Commands;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tv.Events;
using NzbDrone.Core.Music.Events;
namespace NzbDrone.Core.MediaFiles
{
@ -20,7 +20,7 @@ namespace NzbDrone.Core.MediaFiles
void Cleanup();
}
public class RecycleBinProvider : IHandleAsync<SeriesDeletedEvent>, IExecute<CleanUpRecycleBinCommand>, IRecycleBinProvider
public class RecycleBinProvider : IHandleAsync<ArtistDeletedEvent>, IExecute<CleanUpRecycleBinCommand>, IRecycleBinProvider
{
private readonly IDiskTransferService _diskTransferService;
private readonly IDiskProvider _diskProvider;
@ -192,13 +192,13 @@ namespace NzbDrone.Core.MediaFiles
_logger.Debug("Recycling Bin has been cleaned up.");
}
public void HandleAsync(SeriesDeletedEvent message)
public void HandleAsync(ArtistDeletedEvent message)
{
if (message.DeleteFiles)
{
if (_diskProvider.FolderExists(message.Series.Path))
if (_diskProvider.FolderExists(message.Artist.Path))
{
DeleteFolder(message.Series.Path);
DeleteFolder(message.Artist.Path);
}
}
}