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/Download/TrackedDownloads/TrackedDownload.cs

49 lines
1.4 KiB

using NzbDrone.Core.Indexers;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.Download.TrackedDownloads
{
public class TrackedDownload
{
public int DownloadClient { get; set; }
public DownloadClientItem DownloadItem { get; set; }
public TrackedDownloadStage State { get; set; }
public TrackedDownloadStatus Status { get; private set; }
public RemoteAlbum RemoteAlbum { get; set; }
public TrackedDownloadStatusMessage[] StatusMessages { get; private set; }
public DownloadProtocol Protocol { get; set; }
public string Indexer { get; set; }
public bool IsTrackable { get; set; }
public TrackedDownload()
{
StatusMessages = new TrackedDownloadStatusMessage[] {};
}
public void Warn(string message, params object[] args)
{
var statusMessage = string.Format(message, args);
Warn(new TrackedDownloadStatusMessage(DownloadItem.Title, statusMessage));
}
public void Warn(params TrackedDownloadStatusMessage[] statusMessages)
{
Status = TrackedDownloadStatus.Warning;
StatusMessages = statusMessages;
}
}
public enum TrackedDownloadStage
{
Downloading,
Imported,
DownloadFailed
}
public enum TrackedDownloadStatus
{
Ok,
Warning
}
}