2017-09-04 02:20:56 +00:00
|
|
|
using NzbDrone.Core.Indexers;
|
2014-12-19 00:26:42 +00:00
|
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Download.TrackedDownloads
|
|
|
|
{
|
|
|
|
public class TrackedDownload
|
|
|
|
{
|
2015-10-03 17:45:26 +00:00
|
|
|
public int DownloadClient { get; set; }
|
2014-12-19 00:26:42 +00:00
|
|
|
public DownloadClientItem DownloadItem { get; set; }
|
2020-07-26 20:27:30 +00:00
|
|
|
public TrackedDownloadState State { get; set; }
|
2014-12-19 00:26:42 +00:00
|
|
|
public TrackedDownloadStatus Status { get; private set; }
|
2017-08-14 02:58:42 +00:00
|
|
|
public RemoteAlbum RemoteAlbum { get; set; }
|
2014-12-19 00:26:42 +00:00
|
|
|
public TrackedDownloadStatusMessage[] StatusMessages { get; private set; }
|
|
|
|
public DownloadProtocol Protocol { get; set; }
|
2017-09-04 02:20:56 +00:00
|
|
|
public string Indexer { get; set; }
|
|
|
|
public bool IsTrackable { get; set; }
|
2014-12-19 00:26:42 +00:00
|
|
|
|
|
|
|
public TrackedDownload()
|
|
|
|
{
|
2020-01-03 12:49:24 +00:00
|
|
|
StatusMessages = new TrackedDownloadStatusMessage[] { };
|
2014-12-19 00:26:42 +00:00
|
|
|
}
|
|
|
|
|
2015-10-03 17:45:26 +00:00
|
|
|
public void Warn(string message, params object[] args)
|
2014-12-19 00:26:42 +00:00
|
|
|
{
|
2015-10-03 17:45:26 +00:00
|
|
|
var statusMessage = string.Format(message, args);
|
2014-12-19 00:26:42 +00:00
|
|
|
Warn(new TrackedDownloadStatusMessage(DownloadItem.Title, statusMessage));
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Warn(params TrackedDownloadStatusMessage[] statusMessages)
|
|
|
|
{
|
|
|
|
Status = TrackedDownloadStatus.Warning;
|
|
|
|
StatusMessages = statusMessages;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-26 20:27:30 +00:00
|
|
|
public enum TrackedDownloadState
|
2014-12-19 00:26:42 +00:00
|
|
|
{
|
|
|
|
Downloading,
|
2019-02-16 14:49:24 +00:00
|
|
|
DownloadFailed,
|
2020-07-26 20:27:30 +00:00
|
|
|
DownloadFailedPending,
|
|
|
|
ImportPending,
|
2019-02-16 14:49:24 +00:00
|
|
|
Importing,
|
|
|
|
ImportFailed,
|
2020-07-26 20:27:31 +00:00
|
|
|
Imported,
|
|
|
|
Ignored
|
2014-12-19 00:26:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public enum TrackedDownloadStatus
|
|
|
|
{
|
|
|
|
Ok,
|
2020-07-26 20:27:30 +00:00
|
|
|
Warning,
|
|
|
|
Error
|
2014-12-19 00:26:42 +00:00
|
|
|
}
|
|
|
|
}
|