Remove GeneratedCode annotations.

This commit is contained in:
Jesper Utoft 2024-08-12 20:44:59 +02:00
parent 7c99a79757
commit 9e0d39b247
3 changed files with 1 additions and 34 deletions

View File

@ -1,4 +1,3 @@
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
@ -7,7 +6,6 @@ using Newtonsoft.Json.Converters;
namespace NzbDrone.Core.Download.Clients.Tribler
{
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public enum DownloadStatus
{
[EnumMember(Value = @"WAITING4HASHCHECK")]
@ -39,10 +37,8 @@ namespace NzbDrone.Core.Download.Clients.Tribler
[EnumMember(Value = @"STOPPED_ON_ERROR")]
StoppedOnError = 9,
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class Trackers
{
[JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)]
@ -53,11 +49,8 @@ namespace NzbDrone.Core.Download.Clients.Tribler
[JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)]
public string Status { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class Download
{
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
@ -152,14 +145,12 @@ namespace NzbDrone.Core.Download.Clients.Tribler
public bool? ChannelDownload { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class DownloadsResponse
{
[JsonProperty("downloads", NullValueHandling = NullValueHandling.Ignore)]
public ICollection<Download> Downloads { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class AddDownloadRequest
{
[JsonProperty("anon_hops", NullValueHandling = NullValueHandling.Ignore)]
@ -176,7 +167,6 @@ namespace NzbDrone.Core.Download.Clients.Tribler
public string Uri { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class AddDownloadResponse
{
[JsonProperty("infohash", NullValueHandling = NullValueHandling.Ignore)]
@ -186,14 +176,12 @@ namespace NzbDrone.Core.Download.Clients.Tribler
public bool? Started { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class RemoveDownloadRequest
{
[JsonProperty("remove_data", NullValueHandling = NullValueHandling.Ignore)]
public bool? RemoveData { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class DeleteDownloadResponse
{
[JsonProperty("removed", NullValueHandling = NullValueHandling.Ignore)]
@ -203,7 +191,6 @@ namespace NzbDrone.Core.Download.Clients.Tribler
public string Infohash { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class UpdateDownloadRequest
{
[JsonProperty("anon_hops", NullValueHandling = NullValueHandling.Ignore)]
@ -216,7 +203,6 @@ namespace NzbDrone.Core.Download.Clients.Tribler
public string State { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class UpdateDownloadResponse
{
[JsonProperty("modified", NullValueHandling = NullValueHandling.Ignore)]
@ -226,7 +212,6 @@ namespace NzbDrone.Core.Download.Clients.Tribler
public string Infohash { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class File
{
[JsonProperty("size", NullValueHandling = NullValueHandling.Ignore)]
@ -245,7 +230,6 @@ namespace NzbDrone.Core.Download.Clients.Tribler
public bool? Included { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class GetFilesResponse
{
[JsonProperty("files", NullValueHandling = NullValueHandling.Ignore)]

View File

@ -1,19 +1,15 @@
using System.CodeDom.Compiler;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace NzbDrone.Core.Indexers.Tribler
{
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class GetTriblerSettingsResponse
{
[JsonProperty("settings", NullValueHandling = NullValueHandling.Ignore)]
public Settings Settings { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class Settings
{
[JsonProperty("general", NullValueHandling = NullValueHandling.Ignore)]
@ -27,11 +23,8 @@ namespace NzbDrone.Core.Indexers.Tribler
[JsonProperty("download_defaults", NullValueHandling = NullValueHandling.Ignore)]
public DownloadDefaults DownloadDefaults { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class General
{
[JsonProperty("log_dir", NullValueHandling = NullValueHandling.Ignore)]
@ -47,8 +40,6 @@ namespace NzbDrone.Core.Indexers.Tribler
public bool? TestNet { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class TunnelCommunity
{
[JsonProperty("exitnode_enabled", NullValueHandling = NullValueHandling.Ignore)]
@ -73,16 +64,12 @@ namespace NzbDrone.Core.Indexers.Tribler
public bool? TestNet { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public class Dht
{
[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)]
@ -106,11 +93,8 @@ namespace NzbDrone.Core.Indexers.Tribler
[JsonProperty("seeding_time", NullValueHandling = NullValueHandling.Ignore)]
public double? SeedingTime { get; set; }
}
[GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")]
public enum DownloadDefaultsSeedingMode
{
[EnumMember(Value = @"ratio")]
@ -124,6 +108,5 @@ namespace NzbDrone.Core.Indexers.Tribler
[EnumMember(Value = @"never")]
Never = 3,
}
}

View File

@ -120,7 +120,6 @@ namespace NzbDrone.Core.Download.Clients.Tribler
public string AddFromMagnetLink(TriblerDownloadSettings settings, AddDownloadRequest downloadRequest)
{
// run hash through InfoHash class to ensure the correct casing.
var addDownloadRequestBuilder = getRequestBuilder(settings, "downloads");
addDownloadRequestBuilder.Method = System.Net.Http.HttpMethod.Put;
@ -130,6 +129,7 @@ namespace NzbDrone.Core.Download.Clients.Tribler
var infoHashAsString = ProcessRequest<AddDownloadResponse>(addDownloadRequest).Infohash;
// run hash through InfoHash class to ensure the correct casing.
var infoHash = MonoTorrent.InfoHash.FromHex(infoHashAsString);
return infoHash.ToHex();
}