2017-09-04 02:20:56 +00:00
|
|
|
using System;
|
2014-12-19 00:26:42 +00:00
|
|
|
using System.Diagnostics;
|
2014-10-12 22:00:03 +00:00
|
|
|
using NzbDrone.Common.Disk;
|
2020-11-14 05:27:07 +00:00
|
|
|
using NzbDrone.Core.Indexers;
|
2020-11-16 21:34:49 +00:00
|
|
|
using NzbDrone.Core.ThingiProvider;
|
2014-04-19 15:09:22 +00:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Download
|
|
|
|
{
|
2021-12-25 01:55:32 +00:00
|
|
|
[DebuggerDisplay("{DownloadClientInfo?.Name}:{Title}")]
|
2014-04-19 15:09:22 +00:00
|
|
|
public class DownloadClientItem
|
|
|
|
{
|
2020-11-16 21:34:49 +00:00
|
|
|
public DownloadClientItemClientInfo DownloadClientInfo { get; set; }
|
2015-10-03 17:45:26 +00:00
|
|
|
public string DownloadId { get; set; }
|
|
|
|
public string Category { get; set; }
|
|
|
|
public string Title { get; set; }
|
2014-04-19 15:09:22 +00:00
|
|
|
|
2015-10-03 17:45:26 +00:00
|
|
|
public long TotalSize { get; set; }
|
|
|
|
public long RemainingSize { get; set; }
|
2014-05-24 10:50:34 +00:00
|
|
|
public TimeSpan? RemainingTime { get; set; }
|
2018-06-02 01:59:54 +00:00
|
|
|
public double? SeedRatio { get; set; }
|
2014-10-12 22:00:03 +00:00
|
|
|
public OsPath OutputPath { get; set; }
|
2015-10-03 17:45:26 +00:00
|
|
|
public string Message { get; set; }
|
2014-04-19 15:09:22 +00:00
|
|
|
public DownloadItemStatus Status { get; set; }
|
2015-10-03 17:45:26 +00:00
|
|
|
public bool IsEncrypted { get; set; }
|
2017-09-04 02:20:56 +00:00
|
|
|
public bool CanMoveFiles { get; set; }
|
|
|
|
public bool CanBeRemoved { get; set; }
|
2020-11-14 05:27:07 +00:00
|
|
|
public bool Removed { get; set; }
|
|
|
|
|
|
|
|
public DownloadClientItem Clone()
|
|
|
|
{
|
|
|
|
return MemberwiseClone() as DownloadClientItem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public class DownloadClientItemClientInfo
|
|
|
|
{
|
|
|
|
public DownloadProtocol Protocol { get; set; }
|
|
|
|
public string Type { get; set; }
|
|
|
|
public int Id { get; set; }
|
|
|
|
public string Name { get; set; }
|
2017-09-04 02:20:56 +00:00
|
|
|
|
2020-11-16 21:34:49 +00:00
|
|
|
public static DownloadClientItemClientInfo FromDownloadClient<TSettings>(DownloadClientBase<TSettings> downloadClient)
|
|
|
|
where TSettings : IProviderConfig, new()
|
|
|
|
{
|
|
|
|
return new DownloadClientItemClientInfo
|
|
|
|
{
|
|
|
|
Protocol = downloadClient.Protocol,
|
|
|
|
Type = downloadClient.Name,
|
|
|
|
Id = downloadClient.Definition.Id,
|
|
|
|
Name = downloadClient.Definition.Name
|
|
|
|
};
|
|
|
|
}
|
2014-04-19 15:09:22 +00:00
|
|
|
}
|
|
|
|
}
|