1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00

Fix: Deleted files were always ignored when deleted, ignoring AutoIgnorePreviouslyDownloadedEpisodes setting.

This commit is contained in:
Mark McDowall 2012-02-27 21:57:48 -08:00
parent 03a7643b75
commit 1f24e87421

View File

@ -6,6 +6,7 @@
using NLog; using NLog;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
namespace NzbDrone.Core.Providers namespace NzbDrone.Core.Providers
@ -21,12 +22,13 @@ public class DiskScanProvider
private readonly ExternalNotificationProvider _externalNotificationProvider; private readonly ExternalNotificationProvider _externalNotificationProvider;
private readonly DownloadProvider _downloadProvider; private readonly DownloadProvider _downloadProvider;
private readonly SignalRProvider _signalRProvider; private readonly SignalRProvider _signalRProvider;
private readonly ConfigProvider _configProvider;
[Inject] [Inject]
public DiskScanProvider(DiskProvider diskProvider, EpisodeProvider episodeProvider, public DiskScanProvider(DiskProvider diskProvider, EpisodeProvider episodeProvider,
SeriesProvider seriesProvider, MediaFileProvider mediaFileProvider, SeriesProvider seriesProvider, MediaFileProvider mediaFileProvider,
ExternalNotificationProvider externalNotificationProvider, DownloadProvider downloadProvider, ExternalNotificationProvider externalNotificationProvider, DownloadProvider downloadProvider,
SignalRProvider signalRProvider) SignalRProvider signalRProvider, ConfigProvider configProvider)
{ {
_diskProvider = diskProvider; _diskProvider = diskProvider;
_episodeProvider = episodeProvider; _episodeProvider = episodeProvider;
@ -35,6 +37,7 @@ public DiskScanProvider(DiskProvider diskProvider, EpisodeProvider episodeProvid
_externalNotificationProvider = externalNotificationProvider; _externalNotificationProvider = externalNotificationProvider;
_downloadProvider = downloadProvider; _downloadProvider = downloadProvider;
_signalRProvider = signalRProvider; _signalRProvider = signalRProvider;
_configProvider = configProvider;
} }
public DiskScanProvider() public DiskScanProvider()
@ -231,7 +234,7 @@ public virtual void CleanUp(IList<EpisodeFile> files)
{ {
Logger.Trace("Setting EpisodeFileId for Episode: [{0}] to 0", episode.EpisodeId); Logger.Trace("Setting EpisodeFileId for Episode: [{0}] to 0", episode.EpisodeId);
episode.EpisodeFileId = 0; episode.EpisodeFileId = 0;
episode.Ignored = true; episode.Ignored = _configProvider.AutoIgnorePreviouslyDownloadedEpisodes;
episode.GrabDate = null; episode.GrabDate = null;
episode.PostDownloadStatus = PostDownloadStatusType.Unknown; episode.PostDownloadStatus = PostDownloadStatusType.Unknown;
_episodeProvider.UpdateEpisode(episode); _episodeProvider.UpdateEpisode(episode);