2013-03-06 17:51:47 -08:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
2013-04-14 18:41:39 -07:00
|
|
|
using NzbDrone.Core.Parser.Model;
|
2013-03-06 17:51:47 -08:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.DecisionEngine
|
|
|
|
{
|
|
|
|
public class DownloadDecision
|
|
|
|
{
|
2013-04-28 12:46:13 -07:00
|
|
|
public RemoteEpisode RemoteEpisode { get; private set; }
|
2013-03-06 17:51:47 -08:00
|
|
|
public IEnumerable<string> Rejections { get; private set; }
|
2013-04-07 00:30:37 -07:00
|
|
|
|
2013-03-06 17:51:47 -08:00
|
|
|
public bool Approved
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return !Rejections.Any();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-14 18:41:39 -07:00
|
|
|
public DownloadDecision(RemoteEpisode episode, params string[] rejections)
|
2013-03-06 17:51:47 -08:00
|
|
|
{
|
2013-04-28 12:46:13 -07:00
|
|
|
RemoteEpisode = episode;
|
2013-03-06 17:51:47 -08:00
|
|
|
Rejections = rejections.ToList();
|
|
|
|
}
|
2013-08-21 21:42:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
{
|
|
|
|
if (Approved)
|
|
|
|
{
|
|
|
|
return "[OK] " + RemoteEpisode;
|
|
|
|
}
|
|
|
|
|
|
|
|
return "[Rejected " + Rejections.Count() + "]" + RemoteEpisode;
|
|
|
|
}
|
2013-03-06 17:51:47 -08:00
|
|
|
}
|
|
|
|
}
|