Switch to PascalCase in generated code.

Use translations for Settings api.
Remove partial from dto classes.
This commit is contained in:
Jesper Utoft 2024-08-12 20:36:06 +02:00
parent fdb990b1ad
commit 7c99a79757
6 changed files with 250 additions and 244 deletions

View File

@ -1,257 +1,254 @@
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace NzbDrone.Core.Download.Clients.Tribler
{
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public enum DownloadStatus
{
[System.Runtime.Serialization.EnumMember(Value = @"WAITING4HASHCHECK")]
WAITING4HASHCHECK = 0,
[EnumMember(Value = @"WAITING4HASHCHECK")]
Waiting4HashCheck = 0,
[System.Runtime.Serialization.EnumMember(Value = @"HASHCHECKING")]
HASHCHECKING = 1,
[EnumMember(Value = @"HASHCHECKING")]
Hashchecking = 1,
[System.Runtime.Serialization.EnumMember(Value = @"METADATA")]
METADATA = 2,
[EnumMember(Value = @"METADATA")]
Metadata = 2,
[System.Runtime.Serialization.EnumMember(Value = @"DOWNLOADING")]
DOWNLOADING = 3,
[EnumMember(Value = @"DOWNLOADING")]
Downloading = 3,
[System.Runtime.Serialization.EnumMember(Value = @"SEEDING")]
SEEDING = 4,
[EnumMember(Value = @"SEEDING")]
Seeding = 4,
[System.Runtime.Serialization.EnumMember(Value = @"STOPPED")]
STOPPED = 5,
[EnumMember(Value = @"STOPPED")]
Stopped = 5,
[System.Runtime.Serialization.EnumMember(Value = @"ALLOCATING_DISKSPACE")]
ALLOCATING_DISKSPACE = 6,
[EnumMember(Value = @"ALLOCATING_DISKSPACE")]
AllocatingDiskspace = 6,
[System.Runtime.Serialization.EnumMember(Value = @"EXIT_NODES")]
EXIT_NODES = 7,
[EnumMember(Value = @"EXIT_NODES")]
Exitnodes = 7,
[System.Runtime.Serialization.EnumMember(Value = @"CIRCUITS")]
CIRCUITS = 8,
[EnumMember(Value = @"CIRCUITS")]
Circuits = 8,
[System.Runtime.Serialization.EnumMember(Value = @"STOPPED_ON_ERROR")]
STOPPED_ON_ERROR = 9,
[EnumMember(Value = @"STOPPED_ON_ERROR")]
StoppedOnError = 9,
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class Trackers
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class Trackers
{
/// <summary>url of tracker</summary>
[Newtonsoft.Json.JsonProperty("url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)]
public string Url { get; set; }
/// <summary>number of peers</summary>
[Newtonsoft.Json.JsonProperty("peers", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("peers", NullValueHandling = NullValueHandling.Ignore)]
public object Peers { get; set; }
/// <summary>If the tracker is working or not.</summary>
[Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)]
public string Status { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class Download
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class Download
{
[Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
public string Name { get; set; }
[Newtonsoft.Json.JsonProperty("progress", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("progress", NullValueHandling = NullValueHandling.Ignore)]
public float? Progress { get; set; }
[Newtonsoft.Json.JsonProperty("anon_download", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? Anon_download { get; set; }
[JsonProperty("anon_download", NullValueHandling = NullValueHandling.Ignore)]
public bool? AnonDownload { get; set; }
[Newtonsoft.Json.JsonProperty("availability", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("availability", NullValueHandling = NullValueHandling.Ignore)]
public float? Availability { get; set; }
[Newtonsoft.Json.JsonProperty("eta", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("eta", NullValueHandling = NullValueHandling.Ignore)]
public double? Eta { get; set; }
[Newtonsoft.Json.JsonProperty("total_pieces", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public long? Total_pieces { get; set; }
[JsonProperty("total_pieces", NullValueHandling = NullValueHandling.Ignore)]
public long? TotalPieces { get; set; }
[Newtonsoft.Json.JsonProperty("num_seeds", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public long? Num_seeds { get; set; }
[JsonProperty("num_seeds", NullValueHandling = NullValueHandling.Ignore)]
public long? NumSeeds { get; set; }
[Newtonsoft.Json.JsonProperty("total_up", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public long? Total_up { get; set; }
[JsonProperty("total_up", NullValueHandling = NullValueHandling.Ignore)]
public long? TotalUp { get; set; }
[Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
[JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(StringEnumConverter))]
public DownloadStatus? Status { get; set; }
[Newtonsoft.Json.JsonProperty("infohash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("infohash", NullValueHandling = NullValueHandling.Ignore)]
public string Infohash { get; set; }
[Newtonsoft.Json.JsonProperty("ratio", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("ratio", NullValueHandling = NullValueHandling.Ignore)]
public float? Ratio { get; set; }
[Newtonsoft.Json.JsonProperty("vod_mode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? Vod_mode { get; set; }
[JsonProperty("vod_mode", NullValueHandling = NullValueHandling.Ignore)]
public bool? VideoOnDemandMode { get; set; }
[Newtonsoft.Json.JsonProperty("time_added", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public long? Time_added { get; set; }
[JsonProperty("time_added", NullValueHandling = NullValueHandling.Ignore)]
public long? TimeAdded { get; set; }
[Newtonsoft.Json.JsonProperty("max_upload_speed", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public long? Max_upload_speed { get; set; }
[JsonProperty("max_upload_speed", NullValueHandling = NullValueHandling.Ignore)]
public long? MaxUploadSpeed { get; set; }
[Newtonsoft.Json.JsonProperty("max_download_speed", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public long? Max_download_speed { get; set; }
[JsonProperty("max_download_speed", NullValueHandling = NullValueHandling.Ignore)]
public long? MaxDownloadSpeed { get; set; }
[Newtonsoft.Json.JsonProperty("hops", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("hops", NullValueHandling = NullValueHandling.Ignore)]
public long? Hops { get; set; }
[Newtonsoft.Json.JsonProperty("safe_seeding", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? Safe_seeding { get; set; }
[JsonProperty("safe_seeding", NullValueHandling = NullValueHandling.Ignore)]
public bool? SafeSeeding { get; set; }
[Newtonsoft.Json.JsonProperty("error", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("error", NullValueHandling = NullValueHandling.Ignore)]
public string Error { get; set; }
[Newtonsoft.Json.JsonProperty("total_down", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public long? Total_down { get; set; }
[JsonProperty("total_down", NullValueHandling = NullValueHandling.Ignore)]
public long? TotalDown { get; set; }
[Newtonsoft.Json.JsonProperty("vod_prebuffering_progress", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public float? Vod_prebuffering_progress { get; set; }
[JsonProperty("vod_prebuffering_progress", NullValueHandling = NullValueHandling.Ignore)]
public float? VideoOnDemandPrebufferingProgress { get; set; }
[Newtonsoft.Json.JsonProperty("trackers", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<Trackers> Trackers { get; set; }
[JsonProperty("trackers", NullValueHandling = NullValueHandling.Ignore)]
public ICollection<Trackers> Trackers { get; set; }
[Newtonsoft.Json.JsonProperty("size", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("size", NullValueHandling = NullValueHandling.Ignore)]
public long? Size { get; set; }
[Newtonsoft.Json.JsonProperty("peers", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<string> Peers { get; set; }
[JsonProperty("peers", NullValueHandling = NullValueHandling.Ignore)]
public ICollection<string> Peers { get; set; }
[Newtonsoft.Json.JsonProperty("destination", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("destination", NullValueHandling = NullValueHandling.Ignore)]
public string Destination { get; set; }
[Newtonsoft.Json.JsonProperty("speed_down", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public float? Speed_down { get; set; }
[JsonProperty("speed_down", NullValueHandling = NullValueHandling.Ignore)]
public float? SpeedDown { get; set; }
[Newtonsoft.Json.JsonProperty("speed_up", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public float? Speed_up { get; set; }
[JsonProperty("speed_up", NullValueHandling = NullValueHandling.Ignore)]
public float? SpeedUp { get; set; }
[Newtonsoft.Json.JsonProperty("vod_prebuffering_progress_consec", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public float? Vod_prebuffering_progress_consec { get; set; }
[JsonProperty("vod_prebuffering_progress_consec", NullValueHandling = NullValueHandling.Ignore)]
public float? VideoOnDemandPrebufferingProgressConsec { get; set; }
[Newtonsoft.Json.JsonProperty("files", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<string> Files { get; set; }
[JsonProperty("files", NullValueHandling = NullValueHandling.Ignore)]
public ICollection<string> Files { get; set; }
[Newtonsoft.Json.JsonProperty("num_peers", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public long? Num_peers { get; set; }
[JsonProperty("num_peers", NullValueHandling = NullValueHandling.Ignore)]
public long? NumPeers { get; set; }
[Newtonsoft.Json.JsonProperty("channel_download", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("channel_download", NullValueHandling = NullValueHandling.Ignore)]
public bool? ChannelDownload { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class DownloadsResponse
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class DownloadsResponse
{
[Newtonsoft.Json.JsonProperty("downloads", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<Download> Downloads { get; set; }
[JsonProperty("downloads", NullValueHandling = NullValueHandling.Ignore)]
public ICollection<Download> Downloads { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class AddDownloadRequest
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class AddDownloadRequest
{
/// <summary>Number of hops for the anonymous download. No hops is equivalent to a plain download</summary>
[Newtonsoft.Json.JsonProperty("anon_hops", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public long? Anon_hops { get; set; }
[JsonProperty("anon_hops", NullValueHandling = NullValueHandling.Ignore)]
public long? AnonymityHops { get; set; }
/// <summary>Whether the seeding of the download should be anonymous or not</summary>
[Newtonsoft.Json.JsonProperty("safe_seeding", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? Safe_seeding { get; set; }
[JsonProperty("safe_seeding", NullValueHandling = NullValueHandling.Ignore)]
public bool? SafeSeeding { get; set; }
/// <summary>the download destination path of the torrent</summary>
[Newtonsoft.Json.JsonProperty("destination", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("destination", NullValueHandling = NullValueHandling.Ignore)]
public string Destination { get; set; }
/// <summary>The URI of the torrent file that should be downloaded. This URI can either represent a file location, a magnet link or a HTTP(S) url.</summary>
[Newtonsoft.Json.JsonProperty("uri", Required = Newtonsoft.Json.Required.Always)]
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
[JsonProperty("uri", Required = Newtonsoft.Json.Required.Always)]
[Required(AllowEmptyStrings = true)]
public string Uri { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class AddDownloadResponse
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class AddDownloadResponse
{
[Newtonsoft.Json.JsonProperty("infohash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("infohash", NullValueHandling = NullValueHandling.Ignore)]
public string Infohash { get; set; }
[Newtonsoft.Json.JsonProperty("started", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("started", NullValueHandling = NullValueHandling.Ignore)]
public bool? Started { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class RemoveDownloadRequest
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class RemoveDownloadRequest
{
/// <summary>Whether or not to remove the associated data</summary>
[Newtonsoft.Json.JsonProperty("remove_data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? Remove_data { get; set; }
[JsonProperty("remove_data", NullValueHandling = NullValueHandling.Ignore)]
public bool? RemoveData { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class DeleteDownloadResponse
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class DeleteDownloadResponse
{
[Newtonsoft.Json.JsonProperty("removed", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("removed", NullValueHandling = NullValueHandling.Ignore)]
public bool? Removed { get; set; }
[Newtonsoft.Json.JsonProperty("infohash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("infohash", NullValueHandling = NullValueHandling.Ignore)]
public string Infohash { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class UpdateDownloadRequest
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class UpdateDownloadRequest
{
/// <summary>The anonymity of a download can be changed at runtime by passing the anon_hops parameter, however, this must be the only parameter in this request.</summary>
[Newtonsoft.Json.JsonProperty("anon_hops", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public long? Anon_hops { get; set; }
[JsonProperty("anon_hops", NullValueHandling = NullValueHandling.Ignore)]
public long? AnonHops { get; set; }
[Newtonsoft.Json.JsonProperty("selected_files", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<int> Selected_files { get; set; }
[JsonProperty("selected_files", NullValueHandling = NullValueHandling.Ignore)]
public ICollection<int> Selected_files { get; set; }
/// <summary>State parameter to be passed to modify the state of the download (resume/stop/recheck)</summary>
[Newtonsoft.Json.JsonProperty("state", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
public string State { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class UpdateDownloadResponse
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class UpdateDownloadResponse
{
[Newtonsoft.Json.JsonProperty("modified", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("modified", NullValueHandling = NullValueHandling.Ignore)]
public bool? Modified { get; set; }
[Newtonsoft.Json.JsonProperty("infohash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("infohash", NullValueHandling = NullValueHandling.Ignore)]
public string Infohash { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class File
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class File
{
[Newtonsoft.Json.JsonProperty("size", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("size", NullValueHandling = NullValueHandling.Ignore)]
public long? Size { get; set; }
[Newtonsoft.Json.JsonProperty("index", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("index", NullValueHandling = NullValueHandling.Ignore)]
public long? Index { get; set; }
[Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
public string Name { get; set; }
[Newtonsoft.Json.JsonProperty("progress", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("progress", NullValueHandling = NullValueHandling.Ignore)]
public float? Progress { get; set; }
[Newtonsoft.Json.JsonProperty("included", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("included", NullValueHandling = NullValueHandling.Ignore)]
public bool? Included { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class GetFilesResponse
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class GetFilesResponse
{
[Newtonsoft.Json.JsonProperty("files", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<File> Files { get; set; }
[JsonProperty("files", NullValueHandling = NullValueHandling.Ignore)]
public ICollection<File> Files { get; set; }
}
}

View File

@ -1,128 +1,128 @@
using System.CodeDom.Compiler;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace NzbDrone.Core.Indexers.Tribler
{
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class GetTriblerSettingsResponse
{
[Newtonsoft.Json.JsonProperty("settings", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("settings", NullValueHandling = NullValueHandling.Ignore)]
public Settings Settings { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class Settings
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class Settings
{
[Newtonsoft.Json.JsonProperty("general", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("general", NullValueHandling = NullValueHandling.Ignore)]
public General General { get; set; }
[Newtonsoft.Json.JsonProperty("tunnel_community", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public Tunnel_community Tunnel_community { get; set; }
[JsonProperty("tunnel_community", NullValueHandling = NullValueHandling.Ignore)]
public TunnelCommunity TunnelCommunity { get; set; }
[Newtonsoft.Json.JsonProperty("dht", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("dht", NullValueHandling = NullValueHandling.Ignore)]
public Dht Dht { get; set; }
[Newtonsoft.Json.JsonProperty("download_defaults", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public Download_defaults Download_defaults { get; set; }
[JsonProperty("download_defaults", NullValueHandling = NullValueHandling.Ignore)]
public DownloadDefaults DownloadDefaults { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class General
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class General
{
[Newtonsoft.Json.JsonProperty("log_dir", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Log_dir { get; set; }
[JsonProperty("log_dir", NullValueHandling = NullValueHandling.Ignore)]
public string LogDir { get; set; }
[Newtonsoft.Json.JsonProperty("version", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("version", NullValueHandling = NullValueHandling.Ignore)]
public string Version { get; set; }
[Newtonsoft.Json.JsonProperty("version_checker_enabled", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? Version_checker_enabled { get; set; }
[JsonProperty("version_checker_enabled", NullValueHandling = NullValueHandling.Ignore)]
public bool? VersionCheckerEnabled { get; set; }
[Newtonsoft.Json.JsonProperty("testnet", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? Testnet { get; set; }
[JsonProperty("testnet", NullValueHandling = NullValueHandling.Ignore)]
public bool? TestNet { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class Tunnel_community
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class TunnelCommunity
{
[Newtonsoft.Json.JsonProperty("exitnode_enabled", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? Exitnode_enabled { get; set; }
[JsonProperty("exitnode_enabled", NullValueHandling = NullValueHandling.Ignore)]
public bool? ExitNodeEnabled { get; set; }
[Newtonsoft.Json.JsonProperty("enabled", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("enabled", NullValueHandling = NullValueHandling.Ignore)]
public bool? Enabled { get; set; }
[Newtonsoft.Json.JsonProperty("random_slots", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? Random_slots { get; set; }
[JsonProperty("random_slots", NullValueHandling = NullValueHandling.Ignore)]
public int? RandomSlots { get; set; }
[Newtonsoft.Json.JsonProperty("competing_slots", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? Competing_slots { get; set; }
[JsonProperty("competing_slots", NullValueHandling = NullValueHandling.Ignore)]
public int? CompetingSlots { get; set; }
[Newtonsoft.Json.JsonProperty("min_circuits", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? Min_Circuits { get; set; }
[JsonProperty("min_circuits", NullValueHandling = NullValueHandling.Ignore)]
public int? MinCircuits { get; set; }
[Newtonsoft.Json.JsonProperty("max_circuits", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? Max_Circuits { get; set; }
[JsonProperty("max_circuits", NullValueHandling = NullValueHandling.Ignore)]
public int? MaxCircuits { get; set; }
[Newtonsoft.Json.JsonProperty("testnet", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? Testnet { get; set; }
[JsonProperty("testnet", NullValueHandling = NullValueHandling.Ignore)]
public bool? TestNet { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class Dht
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class Dht
{
[Newtonsoft.Json.JsonProperty("enabled", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("enabled", NullValueHandling = NullValueHandling.Ignore)]
public bool? Enabled { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class DownloadDefaults
{
[JsonProperty("anonymity_enabled", NullValueHandling = NullValueHandling.Ignore)]
public bool? AnonymityEnabled { get; set; }
[JsonProperty("number_hops", NullValueHandling = NullValueHandling.Ignore)]
public int? NumberHops { get; set; }
[JsonProperty("safeseeding_enabled", NullValueHandling = NullValueHandling.Ignore)]
public bool? SafeSeedingEnabled { get; set; }
[JsonProperty("saveas", NullValueHandling = NullValueHandling.Ignore)]
public string SaveAS { get; set; }
[JsonProperty("seeding_mode", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(StringEnumConverter))]
public DownloadDefaultsSeedingMode? SeedingMode { get; set; }
[JsonProperty("seeding_ratio", NullValueHandling = NullValueHandling.Ignore)]
public double? SeedingRatio { get; set; }
[JsonProperty("seeding_time", NullValueHandling = NullValueHandling.Ignore)]
public double? SeedingTime { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class Download_defaults
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public enum DownloadDefaultsSeedingMode
{
[Newtonsoft.Json.JsonProperty("anonymity_enabled", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? Anonymity_enabled { get; set; }
[Newtonsoft.Json.JsonProperty("number_hops", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? Number_hops { get; set; }
[Newtonsoft.Json.JsonProperty("safeseeding_enabled", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? Safeseeding_enabled { get; set; }
[Newtonsoft.Json.JsonProperty("saveas", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Saveas { get; set; }
[Newtonsoft.Json.JsonProperty("seeding_mode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public Download_defaultsSeeding_mode? Seeding_mode { get; set; }
/// <summary>Seeding ratio download/upload</summary>
[Newtonsoft.Json.JsonProperty("seeding_ratio", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double? Seeding_ratio { get; set; }
/// <summary>Seeding time in seconds</summary>
[Newtonsoft.Json.JsonProperty("seeding_time", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double? Seeding_time { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public enum Download_defaultsSeeding_mode
{
[System.Runtime.Serialization.EnumMember(Value = @"ratio")]
[EnumMember(Value = @"ratio")]
Ratio = 0,
[System.Runtime.Serialization.EnumMember(Value = @"forever")]
[EnumMember(Value = @"forever")]
Forever = 1,
[System.Runtime.Serialization.EnumMember(Value = @"time")]
[EnumMember(Value = @"time")]
Time = 2,
[System.Runtime.Serialization.EnumMember(Value = @"never")]
[EnumMember(Value = @"never")]
Never = 3,
}

View File

@ -127,22 +127,22 @@ namespace NzbDrone.Core.Download.Clients.Tribler
switch (download.Status)
{
case DownloadStatus.HASHCHECKING:
case DownloadStatus.WAITING4HASHCHECK:
case DownloadStatus.CIRCUITS:
case DownloadStatus.EXIT_NODES:
case DownloadStatus.DOWNLOADING:
case DownloadStatus.Hashchecking:
case DownloadStatus.Waiting4HashCheck:
case DownloadStatus.Circuits:
case DownloadStatus.Exitnodes:
case DownloadStatus.Downloading:
item.Status = DownloadItemStatus.Downloading;
break;
case DownloadStatus.METADATA:
case DownloadStatus.ALLOCATING_DISKSPACE:
case DownloadStatus.Metadata:
case DownloadStatus.AllocatingDiskspace:
item.Status = DownloadItemStatus.Queued;
break;
case DownloadStatus.SEEDING:
case DownloadStatus.STOPPED:
case DownloadStatus.Seeding:
case DownloadStatus.Stopped:
item.Status = DownloadItemStatus.Completed;
break;
case DownloadStatus.STOPPED_ON_ERROR:
case DownloadStatus.StoppedOnError:
item.Status = DownloadItemStatus.Failed;
break;
default: // new status in API? default to downloading
@ -153,7 +153,7 @@ namespace NzbDrone.Core.Download.Clients.Tribler
}
// override status' if completed but progress is not finished
if (download.Status == DownloadStatus.STOPPED && download.Progress < 1)
if (download.Status == DownloadStatus.Stopped && download.Progress < 1)
{
item.Status = DownloadItemStatus.Paused;
}
@ -184,7 +184,7 @@ namespace NzbDrone.Core.Download.Clients.Tribler
public override DownloadClientInfo GetStatus()
{
var config = _proxy.GetConfig(Settings);
var destDir = config.Settings.Download_defaults.Saveas;
var destDir = config.Settings.DownloadDefaults.SaveAS;
if (Settings.TvCategory.IsNotNullOrWhiteSpace())
{
@ -214,30 +214,30 @@ namespace NzbDrone.Core.Download.Clients.Tribler
}
// if download is still running then it's not finished.
if (torrent.Status != DownloadStatus.STOPPED)
if (torrent.Status != DownloadStatus.Stopped)
{
return false;
}
switch (config.Settings.Download_defaults.Seeding_mode)
switch (config.Settings.DownloadDefaults.SeedingMode)
{
// if in ratio mode, wait for ratio to become larger than expeced. Tribler's DownloadStatus will switch from SEEDING to STOPPED
case Download_defaultsSeeding_mode.Ratio:
case DownloadDefaultsSeedingMode.Ratio:
return torrent.Ratio.HasValue
&& torrent.Ratio >= config.Settings.Download_defaults.Seeding_ratio;
&& torrent.Ratio >= config.Settings.DownloadDefaults.SeedingRatio;
case Download_defaultsSeeding_mode.Time:
var downloadStarted = DateTimeOffset.FromUnixTimeSeconds(torrent.Time_added.Value);
var maxSeedingTime = TimeSpan.FromSeconds(config.Settings.Download_defaults.Seeding_time ?? 0);
case DownloadDefaultsSeedingMode.Time:
var downloadStarted = DateTimeOffset.FromUnixTimeSeconds(torrent.TimeAdded.Value);
var maxSeedingTime = TimeSpan.FromSeconds(config.Settings.DownloadDefaults.SeedingTime ?? 0);
return torrent.Time_added.HasValue
return torrent.TimeAdded.HasValue
&& downloadStarted.Add(maxSeedingTime) < DateTimeOffset.Now;
case Download_defaultsSeeding_mode.Never:
case DownloadDefaultsSeedingMode.Never:
return true;
case Download_defaultsSeeding_mode.Forever:
case DownloadDefaultsSeedingMode.Forever:
default:
return false;
}
@ -249,8 +249,8 @@ namespace NzbDrone.Core.Download.Clients.Tribler
{
Destination = GetDownloadDirectory(),
Uri = magnetLink,
Safe_seeding = Settings.SafeSeeding,
Anon_hops = Settings.AnonymityLevel
SafeSeeding = Settings.SafeSeeding,
AnonymityHops = Settings.AnonymityLevel
};
return _proxy.AddFromMagnetLink(Settings, addDownloadRequestObject);
@ -286,7 +286,7 @@ namespace NzbDrone.Core.Download.Clients.Tribler
}
var config = _proxy.GetConfig(Settings);
var destDir = config.Settings.Download_defaults.Saveas;
var destDir = config.Settings.DownloadDefaults.SaveAS;
return $"{destDir.TrimEnd('/')}/{Settings.TvCategory}";
}

View File

@ -105,7 +105,7 @@ namespace NzbDrone.Core.Download.Clients.Tribler
{
var deleteDownloadRequestObject = new RemoveDownloadRequest
{
Remove_data = deleteData
RemoveData = deleteData
};
var deleteRequestBuilder = getRequestBuilder(settings, "downloads/" + item.DownloadId.ToLower());
@ -124,7 +124,7 @@ namespace NzbDrone.Core.Download.Clients.Tribler
var addDownloadRequestBuilder = getRequestBuilder(settings, "downloads");
addDownloadRequestBuilder.Method = System.Net.Http.HttpMethod.Put;
// manually set content of delete request.
// manually set content of download request.
var addDownloadRequest = addDownloadRequestBuilder.Build();
addDownloadRequest.SetContent(Json.ToJson(downloadRequest));

View File

@ -48,25 +48,28 @@ namespace NzbDrone.Core.Download.Clients.Tribler
[FieldDefinition(2, Label = "Port", Type = FieldType.Textbox)]
public int Port { get; set; }
[FieldDefinition(3, Label = "Use SSL", Type = FieldType.Checkbox, HelpText = "Use secure connection when connecting to Tribler")]
[FieldDefinition(3, Label = "UseSsl", Type = FieldType.Checkbox, HelpText = "DownloadClientSettingsUseSslHelpText")]
public bool UseSsl { get; set; }
[FieldDefinition(4, Label = "Url Base", Type = FieldType.Textbox, Advanced = true, HelpText = "Adds a prefix to the tribler url, eg http://[host]:[port]/[urlBase], defaults to ''")]
[FieldDefinition(4, Label = "UrlBase", Type = FieldType.Textbox, Advanced = true, HelpText = "DownloadClientSettingsUrlBaseHelpText")]
[FieldToken(TokenField.HelpText, "UrlBase", "clientName", "Tribler")]
[FieldToken(TokenField.HelpText, "UrlBase", "url", "http://[host]:[port]/[urlBase]")]
public string UrlBase { get; set; }
[FieldDefinition(5, Label = "ApiKey", Type = FieldType.Textbox, Privacy = PrivacyLevel.ApiKey, HelpText = "Api key, found in %APPDATA%\\Roaming\\.Tribler\\7.10\\triblerd.conf, the api key is [api].key, NOT [http_api].key")]
[FieldDefinition(5, Label = "ApiKey", Type = FieldType.Textbox, Privacy = PrivacyLevel.ApiKey, HelpText = "DownloadClientTriblerSettingsApiKeyHelpText")]
public string ApiKey { get; set; }
[FieldDefinition(6, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Sonarr avoids conflicts with unrelated downloads, but it's optional. Creates a [category] subdirectory in the output directory.")]
[FieldDefinition(6, Label = "Category", Type = FieldType.Textbox, HelpText = "DownloadClientSettingsCategoryHelpText")]
public string TvCategory { get; set; }
[FieldDefinition(7, Label = "Directory", Type = FieldType.Textbox, Advanced = true, HelpText = "Optional location to put downloads in, leave blank to use the default Transmission location")]
[FieldDefinition(7, Label = "Directory", Type = FieldType.Textbox, Advanced = true, HelpText = "DownloadClientTriblerSettingsDirectoryHelpText")]
public string TvDirectory { get; set; }
[FieldDefinition(8, Label = "AnonymityLevel", Type = FieldType.Number, HelpText = "Number of proxies to use when downloading content. To disable set to 0. Proxies reduce download/upload speed. See https://www.tribler.org/anonymity.html")]
[FieldDefinition(8, Label = "DownloadClientTriblerSettingsAnonymityLevel", Type = FieldType.Number, HelpText = "DownloadClientTriblerSettingsAnonymityLevelHelpText")]
public int AnonymityLevel { get; set; }
[FieldDefinition(9, Label = "SafeSeeding", Type = FieldType.Checkbox, HelpText = "If seeding only should be done through proxies. The Anonymity level defines the number of proxies used. See https://www.tribler.org/anonymity.html")]
[FieldDefinition(9, Label = "DownloadClientTriblerSettingsSafeSeeding", Type = FieldType.Checkbox, HelpText = "DownloadClientTriblerSettingsSafeSeedingHelpText")]
public bool SafeSeeding { get; set; }
public NzbDroneValidationResult Validate()

View File

@ -534,6 +534,12 @@
"DownloadClientStatusSingleClientHealthCheckMessage": "Download clients unavailable due to failures: {downloadClientNames}",
"DownloadClientTransmissionSettingsDirectoryHelpText": "Optional location to put downloads in, leave blank to use the default Transmission location",
"DownloadClientTransmissionSettingsUrlBaseHelpText": "Adds a prefix to the {clientName} rpc url, eg {url}, defaults to '{defaultUrl}'",
"DownloadClientTriblerSettingsAnonymityLevel": "Anonymity level",
"DownloadClientTriblerSettingsAnonymityLevelHelpText": "Number of proxies to use when downloading content. To disable set to 0. Proxies reduce download/upload speed. See https://www.tribler.org/anonymity.html",
"DownloadClientTriblerSettingsApiKeyHelpText": "Api key, found in %APPDATA%\\Roaming\\.Tribler\\7.14\\triblerd.conf, the api key is [api].key, NOT [http_api].key",
"DownloadClientTriblerSettingsDirectoryHelpText": "Optional location to put downloads in, leave blank to use the default Tribler location",
"DownloadClientTriblerSettingsSafeSeeding": "Safe Seeding",
"DownloadClientTriblerSettingsSafeSeedingHelpText": "If seeding only should be done through proxies. The Anonymity level defines the number of proxies used. See https://www.tribler.org/anonymity.html",
"DownloadClientUTorrentTorrentStateError": "uTorrent is reporting an error",
"DownloadClientValidationApiKeyIncorrect": "API Key Incorrect",
"DownloadClientValidationApiKeyRequired": "API Key Required",