mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -04:00
Profiles
Indexes are created with the same uniqueness when copying a table New: Non-English episode support New: Renamed Quality Profiles to Profiles and made them more powerful New: Configurable wait time before grabbing a release to wait for a better quality
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
namespace NzbDrone.Core.DecisionEngine
|
||||
{
|
||||
public class DownloadDecision
|
||||
{
|
||||
public RemoteEpisode RemoteEpisode { get; private set; }
|
||||
public IEnumerable<Rejection> Rejections { get; private set; }
|
||||
|
||||
public bool Approved
|
||||
{
|
||||
get
|
||||
{
|
||||
return !Rejections.Any();
|
||||
}
|
||||
}
|
||||
|
||||
public bool TemporarilyRejected
|
||||
{
|
||||
get
|
||||
{
|
||||
return Rejections.Any() && Rejections.All(r => r.Type == RejectionType.Temporary);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Rejected
|
||||
{
|
||||
get
|
||||
{
|
||||
return Rejections.Any() && Rejections.All(r => r.Type == RejectionType.Permanent);
|
||||
}
|
||||
}
|
||||
|
||||
public DownloadDecision(RemoteEpisode episode, params Rejection[] rejections)
|
||||
{
|
||||
RemoteEpisode = episode;
|
||||
Rejections = rejections.ToList();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (Approved)
|
||||
{
|
||||
return "[OK] " + RemoteEpisode;
|
||||
}
|
||||
|
||||
return "[Rejected " + Rejections.Count() + "]" + RemoteEpisode;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user