Fixed: Movies not getting unmonitored when folder gets deleted.

Fixes #1191, Fixes #1590
Leonardo Galli 7 years ago
parent 032fc68892
commit 0bc61bea38

@ -161,15 +161,9 @@ namespace NzbDrone.Core.MediaFiles
if (!_diskProvider.FolderExists(movie.Path)) if (!_diskProvider.FolderExists(movie.Path))
{ {
if (_configService.CreateEmptySeriesFolders && if (movie.MovieFileId != 0)
_diskProvider.FolderExists(rootFolder))
{
_logger.Debug("Creating missing movies folder: {0}", movie.Path);
_diskProvider.CreateFolder(movie.Path);
SetPermissions(movie.Path);
}
else
{ {
//Since there is no folder, there can't be any files right?
// Delete Movie from MovieFiles // Delete Movie from MovieFiles
_movieFileRepository.Delete(movie.MovieFileId); _movieFileRepository.Delete(movie.MovieFileId);
@ -179,6 +173,13 @@ namespace NzbDrone.Core.MediaFiles
_logger.Debug("Movies folder doesn't exist: {0}", movie.Path); _logger.Debug("Movies folder doesn't exist: {0}", movie.Path);
} }
else if (_configService.CreateEmptySeriesFolders &&
_diskProvider.FolderExists(rootFolder))
{
_logger.Debug("Creating missing movies folder: {0}", movie.Path);
_diskProvider.CreateFolder(movie.Path);
SetPermissions(movie.Path);
}
_eventAggregator.PublishEvent(new MovieScanSkippedEvent(movie, MovieScanSkippedReason.MovieFolderDoesNotExist)); _eventAggregator.PublishEvent(new MovieScanSkippedEvent(movie, MovieScanSkippedReason.MovieFolderDoesNotExist));
return; return;

Loading…
Cancel
Save