mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-11-24 08:42:19 +02:00
Fixed: Search for newly added episodes if disk rescanning is disabled after refresh
This commit is contained in:
parent
a3e2299011
commit
00ab449ebe
@ -1,4 +1,4 @@
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Core.MediaFiles.Events
|
||||
@ -18,6 +18,8 @@ public SeriesScanSkippedEvent(Series series, SeriesScanSkippedReason reason)
|
||||
public enum SeriesScanSkippedReason
|
||||
{
|
||||
RootFolderDoesNotExist,
|
||||
RootFolderIsEmpty
|
||||
RootFolderIsEmpty,
|
||||
NeverRescanAfterRefresh,
|
||||
RescanAfterManualRefreshOnly
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,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;
|
||||
@ -157,26 +158,23 @@ private List<Season> UpdateSeasons(Series series, Series seriesInfo)
|
||||
private void RescanSeries(Series series, bool isNew, CommandTrigger trigger)
|
||||
{
|
||||
var rescanAfterRefresh = _configService.RescanAfterRefresh;
|
||||
var shouldRescan = true;
|
||||
|
||||
if (isNew)
|
||||
{
|
||||
_logger.Trace("Forcing rescan of {0}. Reason: New series", series);
|
||||
shouldRescan = true;
|
||||
}
|
||||
else if (rescanAfterRefresh == RescanAfterRefreshType.Never)
|
||||
{
|
||||
_logger.Trace("Skipping rescan of {0}. Reason: never rescan after refresh", series);
|
||||
shouldRescan = false;
|
||||
_eventAggregator.PublishEvent(new SeriesScanSkippedEvent(series, SeriesScanSkippedReason.NeverRescanAfterRefresh));
|
||||
|
||||
return;
|
||||
}
|
||||
else if (rescanAfterRefresh == RescanAfterRefreshType.AfterManual && trigger != CommandTrigger.Manual)
|
||||
{
|
||||
_logger.Trace("Skipping rescan of {0}. Reason: not after automatic scans", series);
|
||||
shouldRescan = false;
|
||||
}
|
||||
_eventAggregator.PublishEvent(new SeriesScanSkippedEvent(series, SeriesScanSkippedReason.RescanAfterManualRefreshOnly));
|
||||
|
||||
if (!shouldRescan)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user