mirror of https://github.com/Radarr/Radarr
Delete files now works. Fixes #127
This commit is contained in:
parent
40809f1d91
commit
942d97931e
|
@ -33,7 +33,8 @@ namespace NzbDrone.Core.MediaFiles
|
|||
//List<MovieFile> Get(IEnumerable<int> ids);
|
||||
}
|
||||
|
||||
public class MediaFileService : IMediaFileService, IHandleAsync<SeriesDeletedEvent>
|
||||
public class MediaFileService : IMediaFileService, IHandleAsync<SeriesDeletedEvent>,
|
||||
IHandleAsync<MovieDeletedEvent>
|
||||
{
|
||||
private readonly IEventAggregator _eventAggregator;
|
||||
private readonly IMediaFileRepository _mediaFileRepository;
|
||||
|
@ -155,5 +156,14 @@ namespace NzbDrone.Core.MediaFiles
|
|||
{
|
||||
return _movieFileRepository.Get(id);
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleAsync(MovieDeletedEvent message)
|
||||
{
|
||||
if (message.DeleteFiles == true)
|
||||
{
|
||||
var files = GetFilesByMovie(message.Movie.Id);
|
||||
_movieFileRepository.DeleteMany(files);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -36,7 +36,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-md-offset-1 col-md-5 delete-files-info x-delete-files-info">
|
||||
{{#if hasFile}}1{{#else}}0{{/if}} movie file(s) will be deleted
|
||||
{{#if hasFile}}1{{else}}0{{/if}} movie file(s) will be deleted
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue