You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
875 B
37 lines
875 B
12 years ago
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
12 years ago
|
using NzbDrone.Core.Parser.Model;
|
||
12 years ago
|
|
||
|
namespace NzbDrone.Core.DecisionEngine
|
||
|
{
|
||
|
public class DownloadDecision
|
||
|
{
|
||
12 years ago
|
public RemoteEpisode RemoteEpisode { get; private set; }
|
||
12 years ago
|
public IEnumerable<string> Rejections { get; private set; }
|
||
12 years ago
|
|
||
12 years ago
|
public bool Approved
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return !Rejections.Any();
|
||
|
}
|
||
|
}
|
||
|
|
||
12 years ago
|
public DownloadDecision(RemoteEpisode episode, params string[] rejections)
|
||
12 years ago
|
{
|
||
12 years ago
|
RemoteEpisode = episode;
|
||
12 years ago
|
Rejections = rejections.ToList();
|
||
|
}
|
||
12 years ago
|
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
if (Approved)
|
||
|
{
|
||
|
return "[OK] " + RemoteEpisode;
|
||
|
}
|
||
|
|
||
|
return "[Rejected " + Rejections.Count() + "]" + RemoteEpisode;
|
||
|
}
|
||
12 years ago
|
}
|
||
|
}
|