From e71973b16c4dc22bcb3c511607696ee01a5c00ab Mon Sep 17 00:00:00 2001 From: Qstick Date: Thu, 30 Apr 2020 19:46:53 -0400 Subject: [PATCH] Cleanup Sonarr References --- .../Specifications/AlreadyImportedSpecification.cs | 8 ++++---- .../Download/TrackedDownloads/TrackedDownloadService.cs | 2 +- .../MediaFiles/MediaFileTableCleanupService.cs | 9 --------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/AlreadyImportedSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/AlreadyImportedSpecification.cs index 2773254ac..47bba7aaf 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/AlreadyImportedSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/AlreadyImportedSpecification.cs @@ -44,19 +44,19 @@ namespace NzbDrone.Core.DecisionEngine.Specifications { if (!movie.HasFile) { - _logger.Debug("Skipping already imported check for episode without file"); + _logger.Debug("Skipping already imported check for movie without file"); return Decision.Accept(); } - var historyForEpisode = _historyService.GetByMovieId(movie.Id, null); - var lastGrabbed = historyForEpisode.FirstOrDefault(h => h.EventType == MovieHistoryEventType.Grabbed); + var historyForMovie = _historyService.GetByMovieId(movie.Id, null); + var lastGrabbed = historyForMovie.FirstOrDefault(h => h.EventType == MovieHistoryEventType.Grabbed); if (lastGrabbed == null) { return Decision.Accept(); } - var imported = historyForEpisode.FirstOrDefault(h => + var imported = historyForMovie.FirstOrDefault(h => h.EventType == MovieHistoryEventType.DownloadFolderImported && h.DownloadId == lastGrabbed.DownloadId); diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs index 36eeaf4c3..7222079f9 100644 --- a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs +++ b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs @@ -207,7 +207,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads existingItem.CanBeRemoved != downloadItem.CanBeRemoved || existingItem.CanMoveFiles != downloadItem.CanMoveFiles) { - _logger.Debug("Tracking '{0}:{1}': ClientState={2}{3} SonarrStage={4} Episode='{5}' OutputPath={6}.", + _logger.Debug("Tracking '{0}:{1}': ClientState={2}{3} RadarrStage={4} Movie='{5}' OutputPath={6}.", downloadItem.DownloadClientInfo.Name, downloadItem.Title, downloadItem.Status, diff --git a/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs b/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs index 97cdf650d..2649234a4 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs @@ -45,15 +45,6 @@ namespace NzbDrone.Core.MediaFiles _mediaFileService.Delete(movieFile, DeleteMediaFileReason.MissingFromDisk); continue; } - - //var localMovie = _parsingService.GetLocalMovie(movieFile.Path, movie); - - //if (localMovie == null) - //{ - // _logger.Debug("File [{0}] parsed episodes has changed, removing from db", localMovie.Path); - // _mediaFileService.Delete(localMovie); - // continue; - //} } catch (Exception ex) {