From db37d020f41c50500065b7c5f43ff34091b9086f Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Wed, 6 Mar 2013 12:30:53 -0800 Subject: [PATCH] renamed report rejection reason. --- .../Series/Delete/DeleteSeriesView.js | 2 +- .../AllowedDownloadSpecificationFixture.cs | 18 ++++++++--------- .../JobTests/SeasonSearchJobTest.cs | 3 ++- .../CheckReportFixture.cs | 7 ++++--- .../EpisodeSearchTests/CheckReportFixture.cs | 13 ++++++------ .../CheckReportFixture.cs | 5 +++-- .../SearchTests/ProcessResultsFixture.cs | 10 +++++----- .../AllowedDownloadSpecification.cs | 20 +++++++++---------- .../ReportRejectionReasons.cs} | 6 ++---- .../Clients/Nzbget/EnqueueResponse.cs | 3 --- .../Download/Clients/Nzbget/ErrorModel.cs | 3 --- .../Download/Clients/Nzbget/JsonError.cs | 3 --- .../Download/Clients/Nzbget/JsonRequest.cs | 3 --- .../Clients/Sabnzbd/SabAddResponse.cs | 2 -- .../Jobs/Implementations/RssSyncJob.cs | 2 +- NzbDrone.Core/NzbDrone.Core.csproj | 2 +- .../Providers/Search/DailyEpisodeSearch.cs | 2 +- .../Providers/Search/EpisodeSearch.cs | 8 ++++---- .../Providers/Search/PartialSeasonSearch.cs | 2 +- NzbDrone.Core/Providers/Search/SearchBase.cs | 12 +++++------ .../Repository/Search/SearchHistory.cs | 2 -- .../Repository/Search/SearchHistoryItem.cs | 3 ++- .../RootFolders/RootFolderService.cs | 2 +- NzbDrone.Core/RootFolders/UnmappedFolder.cs | 6 +----- NzbDrone.Core/Tv/Episode.cs | 5 ++--- 25 files changed, 63 insertions(+), 81 deletions(-) rename NzbDrone.Core/{Model/ReportRejectionType.cs => DecisionEngine/ReportRejectionReasons.cs} (83%) diff --git a/NzbDrone.Backbone/Series/Delete/DeleteSeriesView.js b/NzbDrone.Backbone/Series/Delete/DeleteSeriesView.js index e91b006dd..78b817af0 100644 --- a/NzbDrone.Backbone/Series/Delete/DeleteSeriesView.js +++ b/NzbDrone.Backbone/Series/Delete/DeleteSeriesView.js @@ -1,4 +1,4 @@ -'use strict'; +'use strict'; define(['app', 'Series/SeriesModel'], function () { diff --git a/NzbDrone.Core.Test/DecisionEngineTests/AllowedDownloadSpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/AllowedDownloadSpecificationFixture.cs index 06e2d5952..d310139ed 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/AllowedDownloadSpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/AllowedDownloadSpecificationFixture.cs @@ -113,49 +113,49 @@ namespace NzbDrone.Core.Test.DecisionEngineTests [Test] public void should_be_allowed_if_all_conditions_are_met() { - spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.None); + spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.None); } [Test] public void should_not_be_allowed_if_profile_is_not_allowed() { WithProfileNotAllowed(); - spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.QualityNotWanted); + spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.QualityNotWanted); } [Test] public void should_not_be_allowed_if_size_is_not_allowed() { WithNotAcceptableSize(); - spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.Size); + spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.Size); } [Test] public void should_not_be_allowed_if_disk_is_not_upgrade() { WithNoDiskUpgrade(); - spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.ExistingQualityIsEqualOrBetter); + spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.ExistingQualityIsEqualOrBetter); } [Test] public void should_not_be_allowed_if_episode_is_already_in_queue() { WithEpisodeAlreadyInQueue(); - spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.AlreadyInQueue); + spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.AlreadyInQueue); } [Test] public void should_not_be_allowed_if_report_is_over_retention() { WithOverRetention(); - spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.Retention); + spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.Retention); } [Test] public void should_not_be_allowed_if_episode_aired_before_cutoff() { WithAiredBeforeCustomStartDateCutoff(); - spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.AiredAfterCustomStartDate); + spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.AiredAfterCustomStartDate); } [Test] @@ -166,7 +166,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests WithProfileNotAllowed(); WithOverRetention(); - spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.QualityNotWanted); + spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.QualityNotWanted); } [Test] @@ -174,7 +174,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests { WithLanguageNotWanted(); - spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.LanguageNotWanted); + spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.LanguageNotWanted); } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs b/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs index a1cfb8802..787e36dda 100644 --- a/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs +++ b/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs @@ -5,6 +5,7 @@ using System.Linq; using FizzWare.NBuilder; using Moq; using NUnit.Framework; +using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.Jobs.Implementations; using NzbDrone.Core.Tv; using NzbDrone.Core.Jobs; @@ -49,7 +50,7 @@ namespace NzbDrone.Core.Test.JobTests { var resultItems = Builder.CreateListOfSize(5) .All() - .With(e => e.SearchError = ReportRejectionType.None) + .With(e => e.SearchError = ReportRejectionReasons.None) .With(e => e.Success = true) .Build(); diff --git a/NzbDrone.Core.Test/ProviderTests/SearchTests/DailyEpisodeSearchTests/CheckReportFixture.cs b/NzbDrone.Core.Test/ProviderTests/SearchTests/DailyEpisodeSearchTests/CheckReportFixture.cs index 219ba5031..dc6110bc2 100644 --- a/NzbDrone.Core.Test/ProviderTests/SearchTests/DailyEpisodeSearchTests/CheckReportFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/SearchTests/DailyEpisodeSearchTests/CheckReportFixture.cs @@ -5,6 +5,7 @@ using FizzWare.NBuilder; using FluentAssertions; using Moq; using NUnit.Framework; +using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.Tv; using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; @@ -56,7 +57,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.DailyEpisodeSearchTests .CheckReport(_series, new {Episode = _episode}, _episodeParseResult, _searchHistoryItem) .SearchError .Should() - .Be(ReportRejectionType.WrongEpisode); + .Be(ReportRejectionReasons.WrongEpisode); } [Test] @@ -68,7 +69,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.DailyEpisodeSearchTests .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .SearchError .Should() - .Be(ReportRejectionType.WrongEpisode); + .Be(ReportRejectionReasons.WrongEpisode); } [Test] @@ -78,7 +79,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.DailyEpisodeSearchTests .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .SearchError .Should() - .Be(ReportRejectionType.None); + .Be(ReportRejectionReasons.None); } } } diff --git a/NzbDrone.Core.Test/ProviderTests/SearchTests/EpisodeSearchTests/CheckReportFixture.cs b/NzbDrone.Core.Test/ProviderTests/SearchTests/EpisodeSearchTests/CheckReportFixture.cs index 73a70a681..0b7ab0e42 100644 --- a/NzbDrone.Core.Test/ProviderTests/SearchTests/EpisodeSearchTests/CheckReportFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/SearchTests/EpisodeSearchTests/CheckReportFixture.cs @@ -5,6 +5,7 @@ using FizzWare.NBuilder; using FluentAssertions; using Moq; using NUnit.Framework; +using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.Tv; using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; @@ -57,7 +58,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests .CheckReport(_series, new {Episode = _episode}, _episodeParseResult, _searchHistoryItem) .SearchError .Should() - .Be(ReportRejectionType.WrongSeason); + .Be(ReportRejectionReasons.WrongSeason); } [Test] @@ -69,7 +70,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .SearchError .Should() - .Be(ReportRejectionType.WrongEpisode); + .Be(ReportRejectionReasons.WrongEpisode); } [Test] @@ -79,7 +80,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .SearchError .Should() - .Be(ReportRejectionType.None); + .Be(ReportRejectionReasons.None); } [Test] @@ -94,7 +95,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .SearchError .Should() - .Be(ReportRejectionType.WrongSeason); + .Be(ReportRejectionReasons.WrongSeason); } [Test] @@ -109,7 +110,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .SearchError .Should() - .Be(ReportRejectionType.WrongEpisode); + .Be(ReportRejectionReasons.WrongEpisode); } [Test] @@ -125,7 +126,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .SearchError .Should() - .Be(ReportRejectionType.None); + .Be(ReportRejectionReasons.None); } } } diff --git a/NzbDrone.Core.Test/ProviderTests/SearchTests/PartialSeasonSearchTests/CheckReportFixture.cs b/NzbDrone.Core.Test/ProviderTests/SearchTests/PartialSeasonSearchTests/CheckReportFixture.cs index 5e23c90f7..0ecf6b0d8 100644 --- a/NzbDrone.Core.Test/ProviderTests/SearchTests/PartialSeasonSearchTests/CheckReportFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/SearchTests/PartialSeasonSearchTests/CheckReportFixture.cs @@ -5,6 +5,7 @@ using FizzWare.NBuilder; using FluentAssertions; using Moq; using NUnit.Framework; +using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.Tv; using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; @@ -52,7 +53,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.PartialSeasonSearchTests { Mocker.Resolve() .CheckReport(_series, new { SeasonNumber = 2, Episodes = _episodes }, _episodeParseResult, _searchHistoryItem) - .SearchError.Should().Be(ReportRejectionType.WrongSeason); + .SearchError.Should().Be(ReportRejectionReasons.WrongSeason); } [Test] @@ -60,7 +61,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.PartialSeasonSearchTests { Mocker.Resolve() .CheckReport(_series, new { SeasonNumber = 1, Episodes = _episodes }, _episodeParseResult, _searchHistoryItem) - .SearchError.Should().Be(ReportRejectionType.None); + .SearchError.Should().Be(ReportRejectionReasons.None); } } } diff --git a/NzbDrone.Core.Test/ProviderTests/SearchTests/ProcessResultsFixture.cs b/NzbDrone.Core.Test/ProviderTests/SearchTests/ProcessResultsFixture.cs index a03c204c6..1734cf86b 100644 --- a/NzbDrone.Core.Test/ProviderTests/SearchTests/ProcessResultsFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/SearchTests/ProcessResultsFixture.cs @@ -93,14 +93,14 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests { Mocker.GetMock() .Setup(s => s.IsSatisfiedBy(It.IsAny())) - .Returns(ReportRejectionType.None); + .Returns(ReportRejectionReasons.None); } private void WithQualityNotNeeded() { Mocker.GetMock() .Setup(s => s.IsSatisfiedBy(It.IsAny())) - .Returns(ReportRejectionType.ExistingQualityIsEqualOrBetter); + .Returns(ReportRejectionReasons.ExistingQualityIsEqualOrBetter); } [Test] @@ -124,7 +124,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests Mocker.GetMock() .Setup(s => s.IsSatisfiedBy(It.Is(d => d.Quality.Quality == Quality.Bluray1080p))) - .Returns(ReportRejectionType.None); + .Returns(ReportRejectionReasons.None); var result = Mocker.Resolve().ProcessReports(_matchingSeries, new { }, parseResults, _searchHistory, _notification); @@ -155,7 +155,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests parseResults[2].Age = 100; Mocker.GetMock() - .Setup(s => s.IsSatisfiedBy(It.IsAny())).Returns(ReportRejectionType.None); + .Setup(s => s.IsSatisfiedBy(It.IsAny())).Returns(ReportRejectionReasons.None); var result = Mocker.Resolve().ProcessReports(_matchingSeries, new { }, parseResults, _searchHistory, _notification); @@ -323,7 +323,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests Mocker.GetMock() .Setup(s => s.IsSatisfiedBy(It.Is(d => d.Quality.Quality == Quality.Bluray1080p))) - .Returns(ReportRejectionType.None); + .Returns(ReportRejectionReasons.None); //Act var result = Mocker.Resolve().ProcessReports(_matchingSeries, new { }, parseResults, _searchHistory, _notification); diff --git a/NzbDrone.Core/DecisionEngine/AllowedDownloadSpecification.cs b/NzbDrone.Core/DecisionEngine/AllowedDownloadSpecification.cs index 363f3b612..f25edfdab 100644 --- a/NzbDrone.Core/DecisionEngine/AllowedDownloadSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/AllowedDownloadSpecification.cs @@ -37,19 +37,19 @@ namespace NzbDrone.Core.DecisionEngine { } - public virtual ReportRejectionType IsSatisfiedBy(EpisodeParseResult subject) + public virtual ReportRejectionReasons IsSatisfiedBy(EpisodeParseResult subject) { - if (!_qualityAllowedByProfileSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.QualityNotWanted; - if (!_customStartDateSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.AiredAfterCustomStartDate; - if (!_upgradeDiskSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.ExistingQualityIsEqualOrBetter; - if (!_languageSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.LanguageNotWanted; - if (!_retentionSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.Retention; - if (!_acceptableSizeSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.Size; - if (!_allowedReleaseGroupSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.ReleaseGroupNotWanted; - if (_alreadyInQueueSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.AlreadyInQueue; + if (!_qualityAllowedByProfileSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.QualityNotWanted; + if (!_customStartDateSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.AiredAfterCustomStartDate; + if (!_upgradeDiskSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.ExistingQualityIsEqualOrBetter; + if (!_languageSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.LanguageNotWanted; + if (!_retentionSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.Retention; + if (!_acceptableSizeSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.Size; + if (!_allowedReleaseGroupSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.ReleaseGroupNotWanted; + if (_alreadyInQueueSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.AlreadyInQueue; logger.Debug("Episode {0} is needed", subject); - return ReportRejectionType.None; + return ReportRejectionReasons.None; } } } \ No newline at end of file diff --git a/NzbDrone.Core/Model/ReportRejectionType.cs b/NzbDrone.Core/DecisionEngine/ReportRejectionReasons.cs similarity index 83% rename from NzbDrone.Core/Model/ReportRejectionType.cs rename to NzbDrone.Core/DecisionEngine/ReportRejectionReasons.cs index 54e33a7d1..469028342 100644 --- a/NzbDrone.Core/Model/ReportRejectionType.cs +++ b/NzbDrone.Core/DecisionEngine/ReportRejectionReasons.cs @@ -1,8 +1,6 @@ -using System.Linq; - -namespace NzbDrone.Core.Model +namespace NzbDrone.Core.DecisionEngine { - public enum ReportRejectionType + public enum ReportRejectionReasons { None = 0, WrongSeries = 1, diff --git a/NzbDrone.Core/Download/Clients/Nzbget/EnqueueResponse.cs b/NzbDrone.Core/Download/Clients/Nzbget/EnqueueResponse.cs index b2c7f0fbb..f16799151 100644 --- a/NzbDrone.Core/Download/Clients/Nzbget/EnqueueResponse.cs +++ b/NzbDrone.Core/Download/Clients/Nzbget/EnqueueResponse.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace NzbDrone.Core.Download.Clients.Nzbget { diff --git a/NzbDrone.Core/Download/Clients/Nzbget/ErrorModel.cs b/NzbDrone.Core/Download/Clients/Nzbget/ErrorModel.cs index d7293163b..86de9a15a 100644 --- a/NzbDrone.Core/Download/Clients/Nzbget/ErrorModel.cs +++ b/NzbDrone.Core/Download/Clients/Nzbget/ErrorModel.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace NzbDrone.Core.Download.Clients.Nzbget { diff --git a/NzbDrone.Core/Download/Clients/Nzbget/JsonError.cs b/NzbDrone.Core/Download/Clients/Nzbget/JsonError.cs index a09b2a717..ab2a132d8 100644 --- a/NzbDrone.Core/Download/Clients/Nzbget/JsonError.cs +++ b/NzbDrone.Core/Download/Clients/Nzbget/JsonError.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace NzbDrone.Core.Download.Clients.Nzbget { diff --git a/NzbDrone.Core/Download/Clients/Nzbget/JsonRequest.cs b/NzbDrone.Core/Download/Clients/Nzbget/JsonRequest.cs index 57712d33b..29a22f763 100644 --- a/NzbDrone.Core/Download/Clients/Nzbget/JsonRequest.cs +++ b/NzbDrone.Core/Download/Clients/Nzbget/JsonRequest.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using Newtonsoft.Json; namespace NzbDrone.Core.Download.Clients.Nzbget diff --git a/NzbDrone.Core/Download/Clients/Sabnzbd/SabAddResponse.cs b/NzbDrone.Core/Download/Clients/Sabnzbd/SabAddResponse.cs index 244156805..83246d75e 100644 --- a/NzbDrone.Core/Download/Clients/Sabnzbd/SabAddResponse.cs +++ b/NzbDrone.Core/Download/Clients/Sabnzbd/SabAddResponse.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using Newtonsoft.Json; namespace NzbDrone.Core.Download.Clients.Sabnzbd diff --git a/NzbDrone.Core/Jobs/Implementations/RssSyncJob.cs b/NzbDrone.Core/Jobs/Implementations/RssSyncJob.cs index 9a0de861b..a21f9d12b 100644 --- a/NzbDrone.Core/Jobs/Implementations/RssSyncJob.cs +++ b/NzbDrone.Core/Jobs/Implementations/RssSyncJob.cs @@ -77,7 +77,7 @@ namespace NzbDrone.Core.Jobs.Implementations try { if (_isMonitoredEpisodeSpecification.IsSatisfiedBy(episodeParseResult) && - _allowedDownloadSpecification.IsSatisfiedBy(episodeParseResult) == ReportRejectionType.None && + _allowedDownloadSpecification.IsSatisfiedBy(episodeParseResult) == ReportRejectionReasons.None && _upgradeHistorySpecification.IsSatisfiedBy(episodeParseResult)) { _downloadProvider.DownloadReport(episodeParseResult); diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 3f9d09dbf..37f23dff4 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -327,7 +327,7 @@ - + Code diff --git a/NzbDrone.Core/Providers/Search/DailyEpisodeSearch.cs b/NzbDrone.Core/Providers/Search/DailyEpisodeSearch.cs index 6b9837b19..45939313f 100644 --- a/NzbDrone.Core/Providers/Search/DailyEpisodeSearch.cs +++ b/NzbDrone.Core/Providers/Search/DailyEpisodeSearch.cs @@ -67,7 +67,7 @@ namespace NzbDrone.Core.Providers.Search if (!episodeParseResult.AirDate.HasValue || episodeParseResult.AirDate.Value != episode.AirDate.Value) { logger.Trace("Episode AirDate does not match searched episode number, skipping."); - item.SearchError = ReportRejectionType.WrongEpisode; + item.SearchError = ReportRejectionReasons.WrongEpisode; return item; } diff --git a/NzbDrone.Core/Providers/Search/EpisodeSearch.cs b/NzbDrone.Core/Providers/Search/EpisodeSearch.cs index 264724954..a19e7abe6 100644 --- a/NzbDrone.Core/Providers/Search/EpisodeSearch.cs +++ b/NzbDrone.Core/Providers/Search/EpisodeSearch.cs @@ -83,7 +83,7 @@ namespace NzbDrone.Core.Providers.Search if (options.Episode.SceneSeasonNumber != episodeParseResult.SeasonNumber) { logger.Trace("Season number does not match searched season number, skipping."); - item.SearchError = ReportRejectionType.WrongSeason; + item.SearchError = ReportRejectionReasons.WrongSeason; return item; } @@ -91,7 +91,7 @@ namespace NzbDrone.Core.Providers.Search if (!episodeParseResult.EpisodeNumbers.Contains(options.Episode.SceneEpisodeNumber)) { logger.Trace("Episode number does not match searched episode number, skipping."); - item.SearchError = ReportRejectionType.WrongEpisode; + item.SearchError = ReportRejectionReasons.WrongEpisode; return item; } @@ -102,7 +102,7 @@ namespace NzbDrone.Core.Providers.Search if(options.Episode.SeasonNumber != episodeParseResult.SeasonNumber) { logger.Trace("Season number does not match searched season number, skipping."); - item.SearchError = ReportRejectionType.WrongSeason; + item.SearchError = ReportRejectionReasons.WrongSeason; return item; } @@ -110,7 +110,7 @@ namespace NzbDrone.Core.Providers.Search if (!episodeParseResult.EpisodeNumbers.Contains(options.Episode.EpisodeNumber)) { logger.Trace("Episode number does not match searched episode number, skipping."); - item.SearchError = ReportRejectionType.WrongEpisode; + item.SearchError = ReportRejectionReasons.WrongEpisode; return item; } diff --git a/NzbDrone.Core/Providers/Search/PartialSeasonSearch.cs b/NzbDrone.Core/Providers/Search/PartialSeasonSearch.cs index 22723bb84..988c37be3 100644 --- a/NzbDrone.Core/Providers/Search/PartialSeasonSearch.cs +++ b/NzbDrone.Core/Providers/Search/PartialSeasonSearch.cs @@ -87,7 +87,7 @@ namespace NzbDrone.Core.Providers.Search if(options.SeasonNumber != episodeParseResult.SeasonNumber) { logger.Trace("Season number does not match searched season number, skipping."); - item.SearchError = ReportRejectionType.WrongSeason; + item.SearchError = ReportRejectionReasons.WrongSeason; return item; } diff --git a/NzbDrone.Core/Providers/Search/SearchBase.cs b/NzbDrone.Core/Providers/Search/SearchBase.cs index 14e51f673..3fc37d44c 100644 --- a/NzbDrone.Core/Providers/Search/SearchBase.cs +++ b/NzbDrone.Core/Providers/Search/SearchBase.cs @@ -107,7 +107,7 @@ namespace NzbDrone.Core.Providers.Search if(episodeParseResult.Series == null || ((ModelBase)episodeParseResult.Series).Id != series.Id) { - item.SearchError = ReportRejectionType.WrongSeries; + item.SearchError = ReportRejectionReasons.WrongSeries; continue; } @@ -115,17 +115,17 @@ namespace NzbDrone.Core.Providers.Search if (searchResult.Successes.Intersect(episodeParseResult.Episodes.Select(e => e.Id)).Any()) { - item.SearchError = ReportRejectionType.Skipped; + item.SearchError = ReportRejectionReasons.Skipped; continue; } CheckReport(series, options, episodeParseResult, item); - if (item.SearchError != ReportRejectionType.None) + if (item.SearchError != ReportRejectionReasons.None) continue; item.SearchError = _allowedDownloadSpecification.IsSatisfiedBy(episodeParseResult); - if(item.SearchError == ReportRejectionType.None) + if(item.SearchError == ReportRejectionReasons.None) { if(DownloadReport(notification, episodeParseResult, item)) searchResult.Successes.AddRange(episodeParseResult.Episodes.Select(e => e.Id)); @@ -153,13 +153,13 @@ namespace NzbDrone.Core.Providers.Search return true; } - item.SearchError = ReportRejectionType.DownloadClientFailure; + item.SearchError = ReportRejectionReasons.DownloadClientFailure; } catch (Exception e) { logger.ErrorException("Unable to add report to download queue." + episodeParseResult, e); notification.CurrentMessage = String.Format("Unable to add report to download queue. {0}", episodeParseResult); - item.SearchError = ReportRejectionType.DownloadClientFailure; + item.SearchError = ReportRejectionReasons.DownloadClientFailure; } return false; diff --git a/NzbDrone.Core/Repository/Search/SearchHistory.cs b/NzbDrone.Core/Repository/Search/SearchHistory.cs index 6f922b717..db67e30b1 100644 --- a/NzbDrone.Core/Repository/Search/SearchHistory.cs +++ b/NzbDrone.Core/Repository/Search/SearchHistory.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using NzbDrone.Core.Model; namespace NzbDrone.Core.Repository.Search diff --git a/NzbDrone.Core/Repository/Search/SearchHistoryItem.cs b/NzbDrone.Core/Repository/Search/SearchHistoryItem.cs index e179f7c52..d721f0350 100644 --- a/NzbDrone.Core/Repository/Search/SearchHistoryItem.cs +++ b/NzbDrone.Core/Repository/Search/SearchHistoryItem.cs @@ -1,4 +1,5 @@ using System; +using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.Model; using NzbDrone.Core.Qualities; @@ -14,7 +15,7 @@ namespace NzbDrone.Core.Repository.Search public string NzbUrl { get; set; } public string NzbInfoUrl { get; set; } public bool Success { get; set; } - public ReportRejectionType SearchError { get; set; } + public ReportRejectionReasons SearchError { get; set; } public Quality Quality { get; set; } public bool Proper { get; set; } public int Age { get; set; } diff --git a/NzbDrone.Core/RootFolders/RootFolderService.cs b/NzbDrone.Core/RootFolders/RootFolderService.cs index 28a42f18b..97d1fc28a 100644 --- a/NzbDrone.Core/RootFolders/RootFolderService.cs +++ b/NzbDrone.Core/RootFolders/RootFolderService.cs @@ -116,7 +116,7 @@ namespace NzbDrone.Core.RootFolders } catch (Exception ex) { - Logger.WarnException("Error getting fromm space for: " + pathRoot, ex); + Logger.WarnException("Error getting disk space for: " + pathRoot, ex); } } } diff --git a/NzbDrone.Core/RootFolders/UnmappedFolder.cs b/NzbDrone.Core/RootFolders/UnmappedFolder.cs index fcb43fdc5..de5b28c5e 100644 --- a/NzbDrone.Core/RootFolders/UnmappedFolder.cs +++ b/NzbDrone.Core/RootFolders/UnmappedFolder.cs @@ -1,8 +1,4 @@ -using System.Collections.Generic; -using NzbDrone.Core.Datastore; -using Sqo.Attributes; - -namespace NzbDrone.Core.RootFolders +namespace NzbDrone.Core.RootFolders { public class UnmappedFolder { diff --git a/NzbDrone.Core/Tv/Episode.cs b/NzbDrone.Core/Tv/Episode.cs index 8adffc170..57fb67350 100644 --- a/NzbDrone.Core/Tv/Episode.cs +++ b/NzbDrone.Core/Tv/Episode.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System; +using System; using NzbDrone.Core.Datastore; using NzbDrone.Core.MediaFiles; using NzbDrone.Core.Model; @@ -16,7 +15,7 @@ namespace NzbDrone.Core.Tv public int EpisodeNumber { get; set; } public string Title { get; set; } - //Todo: Since we're displaying next airing relative to the user's timezone we may want to store this as UTC (with airtime + UTC offset) + //Todo: Since we're displaying next airing relative to the user's time zone we may want to store this as UTC (with airtime + UTC offset) public DateTime? AirDate { get; set; } [Text]