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

Tom 7 years ago committed by Leonardo Galli
parent 0c8e264668
commit 8de87bb516

@ -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();

Loading…
Cancel
Save