Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1using NzbDrone.Common.Extensions;
2using NzbDrone.Core.IndexerSearch.Definitions;
3using NzbDrone.Core.Parser.Model;
4
5namespace NzbDrone.Core.DecisionEngine.Specifications
6{
7 public class CustomFormatAllowedbyProfileSpecification : IDecisionEngineSpecification
8 {
9 public SpecificationPriority Priority => SpecificationPriority.Default;
10 public RejectionType Type => RejectionType.Permanent;
11
12 public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
13 {
14 var minScore = subject.Series.QualityProfile.Value.MinFormatScore;
15 var score = subject.CustomFormatScore;
16
17 if (score < minScore)
18 {
19 return Decision.Reject("Custom Formats {0} have score {1} below Series profile minimum {2}", subject.CustomFormats.ConcatToString(), score, minScore);
20 }
21
22 return Decision.Accept();
23 }
24 }
25}
26

After

1using NzbDrone.Common.Extensions;
2using NzbDrone.Core.IndexerSearch.Definitions;
3using NzbDrone.Core.Parser.Model;
4
5namespace NzbDrone.Core.DecisionEngine.Specifications
6{
7 public class CustomFormatAllowedbyProfileSpecification : IDownloadDecisionEngineSpecification
8 {
9 public SpecificationPriority Priority => SpecificationPriority.Default;
10 public RejectionType Type => RejectionType.Permanent;
11
12 public virtual DownloadSpecDecision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
13 {
14 var minScore = subject.Series.QualityProfile.Value.MinFormatScore;
15 var score = subject.CustomFormatScore;
16
17 if (score < minScore)
18 {
19 return DownloadSpecDecision.Reject(DownloadRejectionReason.CustomFormatMinimumScore, "Custom Formats {0} have score {1} below Series profile minimum {2}", subject.CustomFormats.ConcatToString(), score, minScore);
20 }
21
22 return DownloadSpecDecision.Accept();
23 }
24 }
25}
26

Before

compilation_unit
using_directive
using "using"
qualified_name
qualified_name
identifier "NzbDrone"
. "."
identifier "Common"
. "."
identifier "Extensions"
; ";"
using_directive
using "using"
qualified_name
qualified_name
qualified_name
identifier "NzbDrone"
. "."
identifier "Core"
. "."
identifier "IndexerSearch"
. "."
identifier "Definitions"
; ";"
using_directive
using "using"
qualified_name
qualified_name
qualified_name
identifier "NzbDrone"
. "."
identifier "Core"
. "."
identifier "Parser"
. "."
identifier "Model"
; ";"
namespace_declaration
namespace "namespace"
qualified_name
qualified_name
qualified_name
identifier "NzbDrone"
. "."
identifier "Core"
. "."
identifier "DecisionEngine"
. "."
identifier "Specifications"
declaration_list
{ "{"
class_declaration
modifier
public "public"
class "class"
identifier "CustomFormatAllowedbyProfileSpecification"
base_list
: ":"
identifier "IDecisionEngineSpecification"
declaration_list
{ "{"
property_declaration
modifier
public "public"
identifier "SpecificationPriority"
identifier "Priority"
arrow_expression_clause
=> "=>"
member_access_expression
identifier "SpecificationPriority"
. "."
identifier "Default"
; ";"
property_declaration
modifier
public "public"
identifier "RejectionType"
identifier "Type"
arrow_expression_clause
=> "=>"
member_access_expression
identifier "RejectionType"
. "."
identifier "Permanent"
; ";"
method_declaration
modifier
public "public"
modifier
virtual "virtual"
identifier "Decision"
identifier "IsSatisfiedBy"
parameter_list
( "("
parameter
identifier "RemoteEpisode"
identifier "subject"
, ","
parameter
identifier "SearchCriteriaBase"
identifier "searchCriteria"
) ")"
block
{ "{"
local_declaration_statement (+21 nodes collapsed)
local_declaration_statement
variable_declaration
implicit_type
var "var"
variable_declarator
identifier "score"
= "="
member_access_expression
identifier "subject"
. "."
identifier "CustomFormatScore"
; ";"
if_statement
if "if"
( "("
binary_expression
identifier "score"
< "<"
identifier "minScore"
) ")"
block
{ "{"
return_statement
return "return"
invocation_expression
member_access_expression
identifier "Decision"
. "."
identifier "Reject"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content "Custom Formats {0} have score {1} below Series profile minim"...
" "\""
, ","
argument
invocation_expression
member_access_expression
member_access_expression
identifier "subject"
. "."
identifier "CustomFormats"
. "."
identifier "ConcatToString"
argument_list
( "("
) ")"
, ","
argument
identifier "score"
, ","
argument
identifier "minScore"
) ")"
; ";"
} "}"
return_statement
return "return"
invocation_expression
member_access_expression
identifier "Decision"
. "."
identifier "Accept"
argument_list
( "("
) ")"
; ";"
} "}"
} "}"
} "}"

After

compilation_unit
using_directive
using "using"
qualified_name
qualified_name
identifier "NzbDrone"
. "."
identifier "Common"
. "."
identifier "Extensions"
; ";"
using_directive
using "using"
qualified_name
qualified_name
qualified_name
identifier "NzbDrone"
. "."
identifier "Core"
. "."
identifier "IndexerSearch"
. "."
identifier "Definitions"
; ";"
using_directive
using "using"
qualified_name
qualified_name
qualified_name
identifier "NzbDrone"
. "."
identifier "Core"
. "."
identifier "Parser"
. "."
identifier "Model"
; ";"
namespace_declaration
namespace "namespace"
qualified_name
qualified_name
qualified_name
identifier "NzbDrone"
. "."
identifier "Core"
. "."
identifier "DecisionEngine"
. "."
identifier "Specifications"
declaration_list
{ "{"
class_declaration
modifier
public "public"
class "class"
identifier "CustomFormatAllowedbyProfileSpecification"
base_list
: ":"
identifier "IDownloadDecisionEngineSpecification"
declaration_list
{ "{"
property_declaration
modifier
public "public"
identifier "SpecificationPriority"
identifier "Priority"
arrow_expression_clause
=> "=>"
member_access_expression
identifier "SpecificationPriority"
. "."
identifier "Default"
; ";"
property_declaration
modifier
public "public"
identifier "RejectionType"
identifier "Type"
arrow_expression_clause
=> "=>"
member_access_expression
identifier "RejectionType"
. "."
identifier "Permanent"
; ";"
method_declaration
modifier
public "public"
modifier
virtual "virtual"
identifier "DownloadSpecDecision"
identifier "IsSatisfiedBy"
parameter_list
( "("
parameter
identifier "RemoteEpisode"
identifier "subject"
, ","
parameter
identifier "SearchCriteriaBase"
identifier "searchCriteria"
) ")"
block
{ "{"
local_declaration_statement (+21 nodes collapsed)
local_declaration_statement
variable_declaration
implicit_type
var "var"
variable_declarator
identifier "score"
= "="
member_access_expression
identifier "subject"
. "."
identifier "CustomFormatScore"
; ";"
if_statement
if "if"
( "("
binary_expression
identifier "score"
< "<"
identifier "minScore"
) ")"
block
{ "{"
return_statement
return "return"
invocation_expression
member_access_expression
identifier "DownloadSpecDecision"
. "."
identifier "Reject"
argument_list
( "("
argument
member_access_expression
identifier "DownloadRejectionReason"
. "."
identifier "CustomFormatMinimumScore"
, ","
argument
string_literal
" "\""
string_literal_content "Custom Formats {0} have score {1} below Series profile minim"...
" "\""
, ","
argument
invocation_expression
member_access_expression
member_access_expression
identifier "subject"
. "."
identifier "CustomFormats"
. "."
identifier "ConcatToString"
argument_list
( "("
) ")"
, ","
argument
identifier "score"
, ","
argument
identifier "minScore"
) ")"
; ";"
} "}"
return_statement
return "return"
invocation_expression
member_access_expression
identifier "DownloadSpecDecision"
. "."
identifier "Accept"
argument_list
( "("
) ")"
; ";"
} "}"
} "}"
} "}"