mirror of https://github.com/Sonarr/Sonarr
37 lines
1022 B
C#
37 lines
1022 B
C#
using Newtonsoft.Json;
|
|
using NzbDrone.Core.Download.Clients.LibTorrent.Models;
|
|
|
|
namespace NzbDrone.Core.Download.Clients.Porla.Models
|
|
{
|
|
/// <summary> Wraps the LibTorrent Infohash type into a Porla Type for easier handling </summary>
|
|
public sealed class PorlaTorrent
|
|
{
|
|
[JsonProperty("info_hash", NullValueHandling = NullValueHandling.Ignore)]
|
|
[JsonConverter(typeof(LibTorrentInfoHashConverter))]
|
|
public LibTorrentInfoHash InfoHash { get; set; }
|
|
|
|
[JsonConstructor]
|
|
public PorlaTorrent(string hash, string status)
|
|
{
|
|
InfoHash = new LibTorrentInfoHash(hash, status);
|
|
}
|
|
|
|
public PorlaTorrent(LibTorrentInfoHash ltif)
|
|
{
|
|
InfoHash = ltif;
|
|
}
|
|
|
|
public object[] AsParam()
|
|
{
|
|
string[] ret = { InfoHash.Hash, null };
|
|
return ret;
|
|
}
|
|
|
|
public object[] AsParams()
|
|
{
|
|
object[] ret = { "info_hash", AsParam() };
|
|
return ret;
|
|
}
|
|
}
|
|
}
|