Fixed: Movie files & folders will actually get deleted now (#1966) (Fixes #694)

This commit is contained in:
Tom 2017-08-20 08:40:02 -04:00 committed by Leonardo Galli
parent 0c8e264668
commit 8de87bb516
1 changed files with 12 additions and 1 deletions

View File

@ -20,7 +20,7 @@ namespace NzbDrone.Core.MediaFiles
void Cleanup();
}
public class RecycleBinProvider : IHandleAsync<SeriesDeletedEvent>, IExecute<CleanUpRecycleBinCommand>, IRecycleBinProvider
public class RecycleBinProvider : IHandleAsync<SeriesDeletedEvent>, IExecute<CleanUpRecycleBinCommand>, IRecycleBinProvider, IHandleAsync<MovieDeletedEvent>
{
private readonly IDiskTransferService _diskTransferService;
private readonly IDiskProvider _diskProvider;
@ -201,6 +201,17 @@ namespace NzbDrone.Core.MediaFiles
}
}
public void HandleAsync(MovieDeletedEvent message)
{
if (message.DeleteFiles)
{
if (_diskProvider.FolderExists(message.Movie.Path))
{
DeleteFolder(message.Movie.Path);
}
}
}
public void Execute(CleanUpRecycleBinCommand message)
{
Cleanup();