@ -6,13 +6,14 @@ using System.IO;
using System.Linq ;
using System.Net ;
using System.Text ;
using System.Text.Json.Serialization ;
using System.Text.RegularExpressions ;
using FluentValidation ;
using Newtonsoft.Json ;
using NLog ;
using NzbDrone.Common ;
using NzbDrone.Common.Extensions ;
using NzbDrone.Common.Http ;
using NzbDrone.Common.Serializer ;
using NzbDrone.Core.Annotations ;
using NzbDrone.Core.Configuration ;
using NzbDrone.Core.Indexers.Exceptions ;
@ -256,7 +257,7 @@ namespace NzbDrone.Core.Indexers.Definitions
throw new IndexerException ( indexerResponse , $"Unexpected response header {indexerResponse.HttpResponse.Headers.ContentType} from API request, expected {HttpAccept.Json.Value}" ) ;
}
var response = JsonConvert . Deserialize Object < AnimeBytesResponse > ( indexerResponse . Content ) ;
var response = ST Json. Deserialize < AnimeBytesResponse > ( indexerResponse . Content ) ;
if ( response . Matches = = 0 )
{
@ -688,109 +689,104 @@ namespace NzbDrone.Core.Indexers.Definitions
public class AnimeBytesResponse
{
[JsonProperty ("Matches")]
[JsonProperty Name ("Matches")]
public int Matches { get ; set ; }
[JsonProperty ("Groups")]
[JsonProperty Name ("Groups")]
public AnimeBytesGroup [ ] Groups { get ; set ; }
}
public class AnimeBytesGroup
{
[JsonProperty ("ID")]
[JsonProperty Name ("ID")]
public long Id { get ; set ; }
[JsonProperty ("CategoryName")]
[JsonProperty Name ("CategoryName")]
public string CategoryName { get ; set ; }
[JsonProperty ("FullName")]
[JsonProperty Name ("FullName")]
public string FullName { get ; set ; }
[JsonProperty ("GroupName")]
[JsonProperty Name ("GroupName")]
public string GroupName { get ; set ; }
[JsonProperty("SeriesID")]
public long? SeriesId { get ; set ; }
[JsonProperty("SeriesName")]
[JsonPropertyName("SeriesName")]
public string SeriesName { get ; set ; }
[JsonProperty("Year")]
[JsonPropertyName("Year")]
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)]
public int? Year { get ; set ; }
[JsonProperty ("Image")]
[JsonProperty Name ("Image")]
public string Image { get ; set ; }
[JsonProperty ("SynonymnsV2", NullValueHandling = NullValueHandling.Ignore )]
[JsonProperty Name ("SynonymnsV2")]
public Dictionary < string , string > Synonymns { get ; set ; }
[JsonProperty ("Description")]
[JsonProperty Name ("Description")]
public string Description { get ; set ; }
[JsonProperty("DescriptionHTML")]
public string DescriptionHtml { get ; set ; }
[JsonProperty("Tags")]
[JsonPropertyName("Tags")]
public List < string > Tags { get ; set ; }
[JsonProperty ("Torrents")]
[JsonPropertyName("Torrents")]
public List < AnimeBytesTorrent > Torrents { get ; set ; }
}
public class AnimeBytesTorrent
{
[JsonProperty ("ID")]
[JsonProperty Name ("ID")]
public long Id { get ; set ; }
[JsonProperty ("EditionData")]
[JsonProperty Name ("EditionData")]
public AnimeBytesEditionData EditionData { get ; set ; }
[JsonProperty ("RawDownMultiplier")]
[JsonProperty Name ("RawDownMultiplier")]
public double RawDownMultiplier { get ; set ; }
[JsonProperty ("RawUpMultiplier")]
[JsonProperty Name ("RawUpMultiplier")]
public double RawUpMultiplier { get ; set ; }
[JsonProperty ("Link")]
[JsonProperty Name ("Link")]
public Uri Link { get ; set ; }
[JsonProperty ("Property")]
[JsonProperty Name ("Property")]
public string Property { get ; set ; }
[JsonProperty ("Snatched")]
[JsonProperty Name ("Snatched")]
public int Snatched { get ; set ; }
[JsonProperty ("Seeders")]
[JsonProperty Name ("Seeders")]
public int Seeders { get ; set ; }
[JsonProperty ("Leechers")]
[JsonProperty Name ("Leechers")]
public int Leechers { get ; set ; }
[JsonProperty ("Size")]
[JsonProperty Name ("Size")]
public long Size { get ; set ; }
[JsonProperty ("FileCount")]
[JsonProperty Name ("FileCount")]
public int FileCount { get ; set ; }
[JsonProperty ("FileList")]
[JsonProperty Name ("FileList")]
public List < AnimeBytesFile > Files { get ; set ; }
[JsonProperty ("UploadTime")]
[JsonProperty Name ("UploadTime")]
public string UploadTime { get ; set ; }
}
public class AnimeBytesFile
{
[JsonProperty ("filename")]
[JsonProperty Name ("filename")]
public string FileName { get ; set ; }
[JsonProperty ("size")]
[JsonProperty Name ("size")]
public long FileSize { get ; set ; }
}
public class AnimeBytesEditionData
{
[JsonProperty ("EditionTitle")]
[JsonProperty Name ("EditionTitle")]
public string EditionTitle { get ; set ; }
}
}