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.
Lidarr/src/NzbDrone.Core/MediaFiles/TrackImport/ImportResult.cs

40 lines
1.0 KiB

using System.Collections.Generic;
using System.Linq;
using NzbDrone.Common.EnsureThat;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.MediaFiles.TrackImport
{
public class ImportResult
{
public ImportDecision<LocalTrack> 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<LocalTrack> importDecision, params string[] errors)
{
Ensure.That(importDecision, () => importDecision).IsNotNull();
ImportDecision = importDecision;
Errors = errors.ToList();
}
}
}