renamed report rejection reason.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-4
@@ -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,
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Core.Download.Clients.Nzbget
|
||||
{
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Core.Download.Clients.Nzbget
|
||||
{
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Core.Download.Clients.Nzbget
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -327,7 +327,7 @@
|
||||
<Compile Include="Qualities\Quality.cs" />
|
||||
<Compile Include="Repository\Search\SearchHistoryItem.cs" />
|
||||
<Compile Include="Repository\Search\SearchHistory.cs" />
|
||||
<Compile Include="Model\ReportRejectionType.cs" />
|
||||
<Compile Include="DecisionEngine\ReportRejectionReasons.cs" />
|
||||
<Compile Include="Tv\Season.cs" />
|
||||
<Compile Include="Providers\AutoConfigureProvider.cs">
|
||||
<SubType>Code</SubType>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using NzbDrone.Core.Model;
|
||||
|
||||
|
||||
namespace NzbDrone.Core.Repository.Search
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user