|
|
@ -7,6 +7,7 @@ using NzbDrone.Core.AutoTagging;
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.Exceptions;
|
|
|
|
using NzbDrone.Core.Exceptions;
|
|
|
|
using NzbDrone.Core.MediaFiles;
|
|
|
|
using NzbDrone.Core.MediaFiles;
|
|
|
|
|
|
|
|
using NzbDrone.Core.MediaFiles.Events;
|
|
|
|
using NzbDrone.Core.Messaging.Commands;
|
|
|
|
using NzbDrone.Core.Messaging.Commands;
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
using NzbDrone.Core.MetadataSource;
|
|
|
|
using NzbDrone.Core.MetadataSource;
|
|
|
@ -172,26 +173,23 @@ namespace NzbDrone.Core.Movies
|
|
|
|
private void RescanMovie(Movie movie, bool isNew, CommandTrigger trigger)
|
|
|
|
private void RescanMovie(Movie movie, bool isNew, CommandTrigger trigger)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var rescanAfterRefresh = _configService.RescanAfterRefresh;
|
|
|
|
var rescanAfterRefresh = _configService.RescanAfterRefresh;
|
|
|
|
var shouldRescan = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isNew)
|
|
|
|
if (isNew)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Trace("Forcing rescan of {0}. Reason: New movie", movie);
|
|
|
|
_logger.Trace("Forcing rescan of {0}. Reason: New movie", movie);
|
|
|
|
shouldRescan = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (rescanAfterRefresh == RescanAfterRefreshType.Never)
|
|
|
|
else if (rescanAfterRefresh == RescanAfterRefreshType.Never)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Trace("Skipping rescan of {0}. Reason: Never rescan after refresh", movie);
|
|
|
|
_logger.Trace("Skipping rescan of {0}. Reason: Never rescan after refresh", movie);
|
|
|
|
shouldRescan = false;
|
|
|
|
_eventAggregator.PublishEvent(new MovieScanSkippedEvent(movie, MovieScanSkippedReason.NeverRescanAfterRefresh));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (rescanAfterRefresh == RescanAfterRefreshType.AfterManual && trigger != CommandTrigger.Manual)
|
|
|
|
else if (rescanAfterRefresh == RescanAfterRefreshType.AfterManual && trigger != CommandTrigger.Manual)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Trace("Skipping rescan of {0}. Reason: Not after automatic scans", movie);
|
|
|
|
_logger.Trace("Skipping rescan of {0}. Reason: Not after automatic scans", movie);
|
|
|
|
shouldRescan = false;
|
|
|
|
_eventAggregator.PublishEvent(new MovieScanSkippedEvent(movie, MovieScanSkippedReason.RescanAfterManualRefreshOnly));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!shouldRescan)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|