renamed report rejection reason.

pull/4/head
kay.one 12 years ago
parent 28efb7c4ec
commit db37d020f4

@ -1,4 +1,4 @@
'use strict'; 'use strict';
define(['app', 'Series/SeriesModel'], function () { define(['app', 'Series/SeriesModel'], function () {

@ -113,49 +113,49 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test] [Test]
public void should_be_allowed_if_all_conditions_are_met() 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] [Test]
public void should_not_be_allowed_if_profile_is_not_allowed() public void should_not_be_allowed_if_profile_is_not_allowed()
{ {
WithProfileNotAllowed(); WithProfileNotAllowed();
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.QualityNotWanted); spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.QualityNotWanted);
} }
[Test] [Test]
public void should_not_be_allowed_if_size_is_not_allowed() public void should_not_be_allowed_if_size_is_not_allowed()
{ {
WithNotAcceptableSize(); WithNotAcceptableSize();
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.Size); spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.Size);
} }
[Test] [Test]
public void should_not_be_allowed_if_disk_is_not_upgrade() public void should_not_be_allowed_if_disk_is_not_upgrade()
{ {
WithNoDiskUpgrade(); WithNoDiskUpgrade();
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.ExistingQualityIsEqualOrBetter); spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.ExistingQualityIsEqualOrBetter);
} }
[Test] [Test]
public void should_not_be_allowed_if_episode_is_already_in_queue() public void should_not_be_allowed_if_episode_is_already_in_queue()
{ {
WithEpisodeAlreadyInQueue(); WithEpisodeAlreadyInQueue();
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.AlreadyInQueue); spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.AlreadyInQueue);
} }
[Test] [Test]
public void should_not_be_allowed_if_report_is_over_retention() public void should_not_be_allowed_if_report_is_over_retention()
{ {
WithOverRetention(); WithOverRetention();
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.Retention); spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.Retention);
} }
[Test] [Test]
public void should_not_be_allowed_if_episode_aired_before_cutoff() public void should_not_be_allowed_if_episode_aired_before_cutoff()
{ {
WithAiredBeforeCustomStartDateCutoff(); WithAiredBeforeCustomStartDateCutoff();
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.AiredAfterCustomStartDate); spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.AiredAfterCustomStartDate);
} }
[Test] [Test]
@ -166,7 +166,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
WithProfileNotAllowed(); WithProfileNotAllowed();
WithOverRetention(); WithOverRetention();
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.QualityNotWanted); spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.QualityNotWanted);
} }
[Test] [Test]
@ -174,7 +174,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{ {
WithLanguageNotWanted(); WithLanguageNotWanted();
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.LanguageNotWanted); spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionReasons.LanguageNotWanted);
} }
} }
} }

@ -5,6 +5,7 @@ using System.Linq;
using FizzWare.NBuilder; using FizzWare.NBuilder;
using Moq; using Moq;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Jobs.Implementations; using NzbDrone.Core.Jobs.Implementations;
using NzbDrone.Core.Tv; using NzbDrone.Core.Tv;
using NzbDrone.Core.Jobs; using NzbDrone.Core.Jobs;
@ -49,7 +50,7 @@ namespace NzbDrone.Core.Test.JobTests
{ {
var resultItems = Builder<SearchHistoryItem>.CreateListOfSize(5) var resultItems = Builder<SearchHistoryItem>.CreateListOfSize(5)
.All() .All()
.With(e => e.SearchError = ReportRejectionType.None) .With(e => e.SearchError = ReportRejectionReasons.None)
.With(e => e.Success = true) .With(e => e.Success = true)
.Build(); .Build();

@ -5,6 +5,7 @@ using FizzWare.NBuilder;
using FluentAssertions; using FluentAssertions;
using Moq; using Moq;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Tv; using NzbDrone.Core.Tv;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
@ -56,7 +57,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.DailyEpisodeSearchTests
.CheckReport(_series, new {Episode = _episode}, _episodeParseResult, _searchHistoryItem) .CheckReport(_series, new {Episode = _episode}, _episodeParseResult, _searchHistoryItem)
.SearchError .SearchError
.Should() .Should()
.Be(ReportRejectionType.WrongEpisode); .Be(ReportRejectionReasons.WrongEpisode);
} }
[Test] [Test]
@ -68,7 +69,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.DailyEpisodeSearchTests
.CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem)
.SearchError .SearchError
.Should() .Should()
.Be(ReportRejectionType.WrongEpisode); .Be(ReportRejectionReasons.WrongEpisode);
} }
[Test] [Test]
@ -78,7 +79,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.DailyEpisodeSearchTests
.CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem)
.SearchError .SearchError
.Should() .Should()
.Be(ReportRejectionType.None); .Be(ReportRejectionReasons.None);
} }
} }
} }

@ -5,6 +5,7 @@ using FizzWare.NBuilder;
using FluentAssertions; using FluentAssertions;
using Moq; using Moq;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Tv; using NzbDrone.Core.Tv;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
@ -57,7 +58,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests
.CheckReport(_series, new {Episode = _episode}, _episodeParseResult, _searchHistoryItem) .CheckReport(_series, new {Episode = _episode}, _episodeParseResult, _searchHistoryItem)
.SearchError .SearchError
.Should() .Should()
.Be(ReportRejectionType.WrongSeason); .Be(ReportRejectionReasons.WrongSeason);
} }
[Test] [Test]
@ -69,7 +70,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests
.CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem)
.SearchError .SearchError
.Should() .Should()
.Be(ReportRejectionType.WrongEpisode); .Be(ReportRejectionReasons.WrongEpisode);
} }
[Test] [Test]
@ -79,7 +80,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests
.CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem)
.SearchError .SearchError
.Should() .Should()
.Be(ReportRejectionType.None); .Be(ReportRejectionReasons.None);
} }
[Test] [Test]
@ -94,7 +95,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests
.CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem)
.SearchError .SearchError
.Should() .Should()
.Be(ReportRejectionType.WrongSeason); .Be(ReportRejectionReasons.WrongSeason);
} }
[Test] [Test]
@ -109,7 +110,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests
.CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem)
.SearchError .SearchError
.Should() .Should()
.Be(ReportRejectionType.WrongEpisode); .Be(ReportRejectionReasons.WrongEpisode);
} }
[Test] [Test]
@ -125,7 +126,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests
.CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem) .CheckReport(_series, new { Episode = _episode }, _episodeParseResult, _searchHistoryItem)
.SearchError .SearchError
.Should() .Should()
.Be(ReportRejectionType.None); .Be(ReportRejectionReasons.None);
} }
} }
} }

@ -5,6 +5,7 @@ using FizzWare.NBuilder;
using FluentAssertions; using FluentAssertions;
using Moq; using Moq;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Tv; using NzbDrone.Core.Tv;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
@ -52,7 +53,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.PartialSeasonSearchTests
{ {
Mocker.Resolve<PartialSeasonSearch>() Mocker.Resolve<PartialSeasonSearch>()
.CheckReport(_series, new { SeasonNumber = 2, Episodes = _episodes }, _episodeParseResult, _searchHistoryItem) .CheckReport(_series, new { SeasonNumber = 2, Episodes = _episodes }, _episodeParseResult, _searchHistoryItem)
.SearchError.Should().Be(ReportRejectionType.WrongSeason); .SearchError.Should().Be(ReportRejectionReasons.WrongSeason);
} }
[Test] [Test]
@ -60,7 +61,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.PartialSeasonSearchTests
{ {
Mocker.Resolve<PartialSeasonSearch>() Mocker.Resolve<PartialSeasonSearch>()
.CheckReport(_series, new { SeasonNumber = 1, Episodes = _episodes }, _episodeParseResult, _searchHistoryItem) .CheckReport(_series, new { SeasonNumber = 1, Episodes = _episodes }, _episodeParseResult, _searchHistoryItem)
.SearchError.Should().Be(ReportRejectionType.None); .SearchError.Should().Be(ReportRejectionReasons.None);
} }
} }
} }

@ -93,14 +93,14 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests
{ {
Mocker.GetMock<AllowedDownloadSpecification>() Mocker.GetMock<AllowedDownloadSpecification>()
.Setup(s => s.IsSatisfiedBy(It.IsAny<EpisodeParseResult>())) .Setup(s => s.IsSatisfiedBy(It.IsAny<EpisodeParseResult>()))
.Returns(ReportRejectionType.None); .Returns(ReportRejectionReasons.None);
} }
private void WithQualityNotNeeded() private void WithQualityNotNeeded()
{ {
Mocker.GetMock<AllowedDownloadSpecification>() Mocker.GetMock<AllowedDownloadSpecification>()
.Setup(s => s.IsSatisfiedBy(It.IsAny<EpisodeParseResult>())) .Setup(s => s.IsSatisfiedBy(It.IsAny<EpisodeParseResult>()))
.Returns(ReportRejectionType.ExistingQualityIsEqualOrBetter); .Returns(ReportRejectionReasons.ExistingQualityIsEqualOrBetter);
} }
[Test] [Test]
@ -124,7 +124,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests
Mocker.GetMock<AllowedDownloadSpecification>() Mocker.GetMock<AllowedDownloadSpecification>()
.Setup(s => s.IsSatisfiedBy(It.Is<EpisodeParseResult>(d => d.Quality.Quality == Quality.Bluray1080p))) .Setup(s => s.IsSatisfiedBy(It.Is<EpisodeParseResult>(d => d.Quality.Quality == Quality.Bluray1080p)))
.Returns(ReportRejectionType.None); .Returns(ReportRejectionReasons.None);
var result = Mocker.Resolve<TestSearch>().ProcessReports(_matchingSeries, new { }, parseResults, _searchHistory, _notification); var result = Mocker.Resolve<TestSearch>().ProcessReports(_matchingSeries, new { }, parseResults, _searchHistory, _notification);
@ -155,7 +155,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests
parseResults[2].Age = 100; parseResults[2].Age = 100;
Mocker.GetMock<AllowedDownloadSpecification>() Mocker.GetMock<AllowedDownloadSpecification>()
.Setup(s => s.IsSatisfiedBy(It.IsAny<EpisodeParseResult>())).Returns(ReportRejectionType.None); .Setup(s => s.IsSatisfiedBy(It.IsAny<EpisodeParseResult>())).Returns(ReportRejectionReasons.None);
var result = Mocker.Resolve<TestSearch>().ProcessReports(_matchingSeries, new { }, parseResults, _searchHistory, _notification); var result = Mocker.Resolve<TestSearch>().ProcessReports(_matchingSeries, new { }, parseResults, _searchHistory, _notification);
@ -323,7 +323,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests
Mocker.GetMock<AllowedDownloadSpecification>() Mocker.GetMock<AllowedDownloadSpecification>()
.Setup(s => s.IsSatisfiedBy(It.Is<EpisodeParseResult>(d => d.Quality.Quality == Quality.Bluray1080p))) .Setup(s => s.IsSatisfiedBy(It.Is<EpisodeParseResult>(d => d.Quality.Quality == Quality.Bluray1080p)))
.Returns(ReportRejectionType.None); .Returns(ReportRejectionReasons.None);
//Act //Act
var result = Mocker.Resolve<TestSearch>().ProcessReports(_matchingSeries, new { }, parseResults, _searchHistory, _notification); var result = Mocker.Resolve<TestSearch>().ProcessReports(_matchingSeries, new { }, parseResults, _searchHistory, _notification);

@ -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 (!_qualityAllowedByProfileSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.QualityNotWanted;
if (!_customStartDateSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.AiredAfterCustomStartDate; if (!_customStartDateSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.AiredAfterCustomStartDate;
if (!_upgradeDiskSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.ExistingQualityIsEqualOrBetter; if (!_upgradeDiskSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.ExistingQualityIsEqualOrBetter;
if (!_languageSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.LanguageNotWanted; if (!_languageSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.LanguageNotWanted;
if (!_retentionSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.Retention; if (!_retentionSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.Retention;
if (!_acceptableSizeSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.Size; if (!_acceptableSizeSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.Size;
if (!_allowedReleaseGroupSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.ReleaseGroupNotWanted; if (!_allowedReleaseGroupSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.ReleaseGroupNotWanted;
if (_alreadyInQueueSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.AlreadyInQueue; if (_alreadyInQueueSpecification.IsSatisfiedBy(subject)) return ReportRejectionReasons.AlreadyInQueue;
logger.Debug("Episode {0} is needed", subject); logger.Debug("Episode {0} is needed", subject);
return ReportRejectionType.None; return ReportRejectionReasons.None;
} }
} }
} }

@ -1,8 +1,6 @@
using System.Linq; namespace NzbDrone.Core.DecisionEngine
namespace NzbDrone.Core.Model
{ {
public enum ReportRejectionType public enum ReportRejectionReasons
{ {
None = 0, None = 0,
WrongSeries = 1, WrongSeries = 1,

@ -1,7 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Core.Download.Clients.Nzbget namespace NzbDrone.Core.Download.Clients.Nzbget
{ {

@ -1,7 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Core.Download.Clients.Nzbget namespace NzbDrone.Core.Download.Clients.Nzbget
{ {

@ -1,7 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Core.Download.Clients.Nzbget namespace NzbDrone.Core.Download.Clients.Nzbget
{ {

@ -1,7 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace NzbDrone.Core.Download.Clients.Nzbget namespace NzbDrone.Core.Download.Clients.Nzbget

@ -1,7 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace NzbDrone.Core.Download.Clients.Sabnzbd namespace NzbDrone.Core.Download.Clients.Sabnzbd

@ -77,7 +77,7 @@ namespace NzbDrone.Core.Jobs.Implementations
try try
{ {
if (_isMonitoredEpisodeSpecification.IsSatisfiedBy(episodeParseResult) && if (_isMonitoredEpisodeSpecification.IsSatisfiedBy(episodeParseResult) &&
_allowedDownloadSpecification.IsSatisfiedBy(episodeParseResult) == ReportRejectionType.None && _allowedDownloadSpecification.IsSatisfiedBy(episodeParseResult) == ReportRejectionReasons.None &&
_upgradeHistorySpecification.IsSatisfiedBy(episodeParseResult)) _upgradeHistorySpecification.IsSatisfiedBy(episodeParseResult))
{ {
_downloadProvider.DownloadReport(episodeParseResult); _downloadProvider.DownloadReport(episodeParseResult);

@ -327,7 +327,7 @@
<Compile Include="Qualities\Quality.cs" /> <Compile Include="Qualities\Quality.cs" />
<Compile Include="Repository\Search\SearchHistoryItem.cs" /> <Compile Include="Repository\Search\SearchHistoryItem.cs" />
<Compile Include="Repository\Search\SearchHistory.cs" /> <Compile Include="Repository\Search\SearchHistory.cs" />
<Compile Include="Model\ReportRejectionType.cs" /> <Compile Include="DecisionEngine\ReportRejectionReasons.cs" />
<Compile Include="Tv\Season.cs" /> <Compile Include="Tv\Season.cs" />
<Compile Include="Providers\AutoConfigureProvider.cs"> <Compile Include="Providers\AutoConfigureProvider.cs">
<SubType>Code</SubType> <SubType>Code</SubType>

@ -67,7 +67,7 @@ namespace NzbDrone.Core.Providers.Search
if (!episodeParseResult.AirDate.HasValue || episodeParseResult.AirDate.Value != episode.AirDate.Value) if (!episodeParseResult.AirDate.HasValue || episodeParseResult.AirDate.Value != episode.AirDate.Value)
{ {
logger.Trace("Episode AirDate does not match searched episode number, skipping."); logger.Trace("Episode AirDate does not match searched episode number, skipping.");
item.SearchError = ReportRejectionType.WrongEpisode; item.SearchError = ReportRejectionReasons.WrongEpisode;
return item; return item;
} }

@ -83,7 +83,7 @@ namespace NzbDrone.Core.Providers.Search
if (options.Episode.SceneSeasonNumber != episodeParseResult.SeasonNumber) if (options.Episode.SceneSeasonNumber != episodeParseResult.SeasonNumber)
{ {
logger.Trace("Season number does not match searched season number, skipping."); logger.Trace("Season number does not match searched season number, skipping.");
item.SearchError = ReportRejectionType.WrongSeason; item.SearchError = ReportRejectionReasons.WrongSeason;
return item; return item;
} }
@ -91,7 +91,7 @@ namespace NzbDrone.Core.Providers.Search
if (!episodeParseResult.EpisodeNumbers.Contains(options.Episode.SceneEpisodeNumber)) if (!episodeParseResult.EpisodeNumbers.Contains(options.Episode.SceneEpisodeNumber))
{ {
logger.Trace("Episode number does not match searched episode number, skipping."); logger.Trace("Episode number does not match searched episode number, skipping.");
item.SearchError = ReportRejectionType.WrongEpisode; item.SearchError = ReportRejectionReasons.WrongEpisode;
return item; return item;
} }
@ -102,7 +102,7 @@ namespace NzbDrone.Core.Providers.Search
if(options.Episode.SeasonNumber != episodeParseResult.SeasonNumber) if(options.Episode.SeasonNumber != episodeParseResult.SeasonNumber)
{ {
logger.Trace("Season number does not match searched season number, skipping."); logger.Trace("Season number does not match searched season number, skipping.");
item.SearchError = ReportRejectionType.WrongSeason; item.SearchError = ReportRejectionReasons.WrongSeason;
return item; return item;
} }
@ -110,7 +110,7 @@ namespace NzbDrone.Core.Providers.Search
if (!episodeParseResult.EpisodeNumbers.Contains(options.Episode.EpisodeNumber)) if (!episodeParseResult.EpisodeNumbers.Contains(options.Episode.EpisodeNumber))
{ {
logger.Trace("Episode number does not match searched episode number, skipping."); logger.Trace("Episode number does not match searched episode number, skipping.");
item.SearchError = ReportRejectionType.WrongEpisode; item.SearchError = ReportRejectionReasons.WrongEpisode;
return item; return item;
} }

@ -87,7 +87,7 @@ namespace NzbDrone.Core.Providers.Search
if(options.SeasonNumber != episodeParseResult.SeasonNumber) if(options.SeasonNumber != episodeParseResult.SeasonNumber)
{ {
logger.Trace("Season number does not match searched season number, skipping."); logger.Trace("Season number does not match searched season number, skipping.");
item.SearchError = ReportRejectionType.WrongSeason; item.SearchError = ReportRejectionReasons.WrongSeason;
return item; return item;
} }

@ -107,7 +107,7 @@ namespace NzbDrone.Core.Providers.Search
if(episodeParseResult.Series == null || ((ModelBase)episodeParseResult.Series).Id != series.Id) if(episodeParseResult.Series == null || ((ModelBase)episodeParseResult.Series).Id != series.Id)
{ {
item.SearchError = ReportRejectionType.WrongSeries; item.SearchError = ReportRejectionReasons.WrongSeries;
continue; continue;
} }
@ -115,17 +115,17 @@ namespace NzbDrone.Core.Providers.Search
if (searchResult.Successes.Intersect(episodeParseResult.Episodes.Select(e => e.Id)).Any()) if (searchResult.Successes.Intersect(episodeParseResult.Episodes.Select(e => e.Id)).Any())
{ {
item.SearchError = ReportRejectionType.Skipped; item.SearchError = ReportRejectionReasons.Skipped;
continue; continue;
} }
CheckReport(series, options, episodeParseResult, item); CheckReport(series, options, episodeParseResult, item);
if (item.SearchError != ReportRejectionType.None) if (item.SearchError != ReportRejectionReasons.None)
continue; continue;
item.SearchError = _allowedDownloadSpecification.IsSatisfiedBy(episodeParseResult); item.SearchError = _allowedDownloadSpecification.IsSatisfiedBy(episodeParseResult);
if(item.SearchError == ReportRejectionType.None) if(item.SearchError == ReportRejectionReasons.None)
{ {
if(DownloadReport(notification, episodeParseResult, item)) if(DownloadReport(notification, episodeParseResult, item))
searchResult.Successes.AddRange(episodeParseResult.Episodes.Select(e => e.Id)); searchResult.Successes.AddRange(episodeParseResult.Episodes.Select(e => e.Id));
@ -153,13 +153,13 @@ namespace NzbDrone.Core.Providers.Search
return true; return true;
} }
item.SearchError = ReportRejectionType.DownloadClientFailure; item.SearchError = ReportRejectionReasons.DownloadClientFailure;
} }
catch (Exception e) catch (Exception e)
{ {
logger.ErrorException("Unable to add report to download queue." + episodeParseResult, 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); notification.CurrentMessage = String.Format("Unable to add report to download queue. {0}", episodeParseResult);
item.SearchError = ReportRejectionType.DownloadClientFailure; item.SearchError = ReportRejectionReasons.DownloadClientFailure;
} }
return false; return false;

@ -1,7 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using NzbDrone.Core.Model;
namespace NzbDrone.Core.Repository.Search namespace NzbDrone.Core.Repository.Search

@ -1,4 +1,5 @@
using System; using System;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
@ -14,7 +15,7 @@ namespace NzbDrone.Core.Repository.Search
public string NzbUrl { get; set; } public string NzbUrl { get; set; }
public string NzbInfoUrl { get; set; } public string NzbInfoUrl { get; set; }
public bool Success { get; set; } public bool Success { get; set; }
public ReportRejectionType SearchError { get; set; } public ReportRejectionReasons SearchError { get; set; }
public Quality Quality { get; set; } public Quality Quality { get; set; }
public bool Proper { get; set; } public bool Proper { get; set; }
public int Age { get; set; } public int Age { get; set; }

@ -116,7 +116,7 @@ namespace NzbDrone.Core.RootFolders
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.WarnException("Error getting fromm space for: " + pathRoot, ex); Logger.WarnException("Error getting disk space for: " + pathRoot, ex);
} }
} }
} }

@ -1,8 +1,4 @@
using System.Collections.Generic; namespace NzbDrone.Core.RootFolders
using NzbDrone.Core.Datastore;
using Sqo.Attributes;
namespace NzbDrone.Core.RootFolders
{ {
public class UnmappedFolder public class UnmappedFolder
{ {

@ -1,5 +1,4 @@
using System.Linq; using System;
using System;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
@ -16,7 +15,7 @@ namespace NzbDrone.Core.Tv
public int EpisodeNumber { get; set; } public int EpisodeNumber { get; set; }
public string Title { 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; } public DateTime? AirDate { get; set; }
[Text] [Text]

Loading…
Cancel
Save