Lidarr/NzbDrone.Core/DecisionEngine/Specifications/DownloadDecision.cs

37 lines
890 B
C#
Raw Normal View History

2013-03-07 01:51:47 +00:00
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Parser.Model;
2013-03-07 01:51:47 +00:00
2013-09-11 23:33:34 +00:00
namespace NzbDrone.Core.DecisionEngine.Specifications
2013-03-07 01:51:47 +00:00
{
public class DownloadDecision
{
public RemoteEpisode RemoteEpisode { get; private set; }
2013-03-07 01:51:47 +00:00
public IEnumerable<string> Rejections { get; private set; }
2013-04-07 07:30:37 +00:00
2013-03-07 01:51:47 +00:00
public bool Approved
{
get
{
return !Rejections.Any();
}
}
public DownloadDecision(RemoteEpisode episode, params string[] rejections)
2013-03-07 01:51:47 +00:00
{
RemoteEpisode = episode;
2013-03-07 01:51:47 +00:00
Rejections = rejections.ToList();
}
public override string ToString()
{
if (Approved)
{
return "[OK] " + RemoteEpisode;
}
return "[Rejected " + Rejections.Count() + "]" + RemoteEpisode;
}
2013-03-07 01:51:47 +00:00
}
}