mirror of https://github.com/Radarr/Radarr
39 lines
1001 B
C#
39 lines
1001 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using NzbDrone.Common.EnsureThat;
|
|
|
|
namespace NzbDrone.Core.MediaFiles.MovieImport
|
|
{
|
|
public class ImportResult
|
|
{
|
|
public ImportDecision ImportDecision { get; private set; }
|
|
public List<string> Errors { get; private set; }
|
|
|
|
public ImportResultType Result
|
|
{
|
|
get
|
|
{
|
|
if (Errors.Any())
|
|
{
|
|
if (ImportDecision.Approved)
|
|
{
|
|
return ImportResultType.Skipped;
|
|
}
|
|
|
|
return ImportResultType.Rejected;
|
|
}
|
|
|
|
return ImportResultType.Imported;
|
|
}
|
|
}
|
|
|
|
public ImportResult(ImportDecision importDecision, params string[] errors)
|
|
{
|
|
Ensure.That(importDecision, () => importDecision).IsNotNull();
|
|
|
|
ImportDecision = importDecision;
|
|
Errors = errors.ToList();
|
|
}
|
|
}
|
|
}
|