mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-19 00:39:41 +02:00
Fixed: Search for newly added movie if disk rescanning is disabled after refresh
(cherry picked from commit 00ab449ebeb53893b8d4c939e072451845a4d69e) Closes #7543
This commit is contained in:
parent
3412e4139e
commit
d9e337f2fb
@ -1,4 +1,4 @@
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Movies;
|
||||
|
||||
namespace NzbDrone.Core.MediaFiles.Events
|
||||
@ -19,6 +19,8 @@ public enum MovieScanSkippedReason
|
||||
{
|
||||
RootFolderDoesNotExist,
|
||||
RootFolderIsEmpty,
|
||||
MovieFolderDoesNotExist
|
||||
MovieFolderDoesNotExist,
|
||||
NeverRescanAfterRefresh,
|
||||
RescanAfterManualRefreshOnly
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Exceptions;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.MediaFiles.Events;
|
||||
using NzbDrone.Core.Messaging.Commands;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
using NzbDrone.Core.MetadataSource;
|
||||
@ -172,26 +173,23 @@ private Movie RefreshMovieInfo(int movieId)
|
||||
private void RescanMovie(Movie movie, bool isNew, CommandTrigger trigger)
|
||||
{
|
||||
var rescanAfterRefresh = _configService.RescanAfterRefresh;
|
||||
var shouldRescan = true;
|
||||
|
||||
if (isNew)
|
||||
{
|
||||
_logger.Trace("Forcing rescan of {0}. Reason: New movie", movie);
|
||||
shouldRescan = true;
|
||||
}
|
||||
else if (rescanAfterRefresh == RescanAfterRefreshType.Never)
|
||||
{
|
||||
_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)
|
||||
{
|
||||
_logger.Trace("Skipping rescan of {0}. Reason: Not after automatic scans", movie);
|
||||
shouldRescan = false;
|
||||
}
|
||||
_eventAggregator.PublishEvent(new MovieScanSkippedEvent(movie, MovieScanSkippedReason.RescanAfterManualRefreshOnly));
|
||||
|
||||
if (!shouldRescan)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user