|
|
|
@ -111,6 +111,14 @@ namespace NzbDrone.Core.Extras.Files
|
|
|
|
|
public void HandleAsync(EpisodeFileDeletedEvent message)
|
|
|
|
|
{
|
|
|
|
|
var episodeFile = message.EpisodeFile;
|
|
|
|
|
|
|
|
|
|
if (message.Reason == DeleteMediaFileReason.NoLinkedEpisodes)
|
|
|
|
|
{
|
|
|
|
|
_logger.Debug("Removing episode file from DB as part of cleanup routine, not deleting extra files from disk.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var series = _seriesService.GetSeries(message.EpisodeFile.SeriesId);
|
|
|
|
|
|
|
|
|
|
foreach (var extra in _repository.GetFilesByEpisodeFile(episodeFile.Id))
|
|
|
|
@ -131,6 +139,7 @@ namespace NzbDrone.Core.Extras.Files
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_logger.Debug("Deleting Extra from database for episode file: {0}", episodeFile);
|
|
|
|
|
_repository.DeleteForEpisodeFile(episodeFile.Id);
|
|
|
|
|