mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: (AnimeBytes) apply LinksUnionConverter to model (#353)
This commit is contained in:
@@ -581,6 +581,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
public long Comments { get; set; }
|
public long Comments { get; set; }
|
||||||
|
|
||||||
[JsonProperty("Links")]
|
[JsonProperty("Links")]
|
||||||
|
[JsonConverter(typeof(LinksUnionConverter))]
|
||||||
public LinksUnion Links { get; set; }
|
public LinksUnion Links { get; set; }
|
||||||
|
|
||||||
[JsonProperty("Votes")]
|
[JsonProperty("Votes")]
|
||||||
@@ -703,21 +704,6 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
public static implicit operator Synonymns(Dictionary<string, string> stringMap) => new Synonymns { StringMap = stringMap };
|
public static implicit operator Synonymns(Dictionary<string, string> stringMap) => new Synonymns { StringMap = stringMap };
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static class Converter
|
|
||||||
{
|
|
||||||
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
|
|
||||||
{
|
|
||||||
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
|
|
||||||
DateParseHandling = DateParseHandling.None,
|
|
||||||
Converters =
|
|
||||||
{
|
|
||||||
LinksUnionConverter.Singleton,
|
|
||||||
SynonymnsConverter.Singleton,
|
|
||||||
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class LinksUnionConverter : JsonConverter
|
internal class LinksUnionConverter : JsonConverter
|
||||||
{
|
{
|
||||||
public override bool CanConvert(Type t) => t == typeof(LinksUnion) || t == typeof(LinksUnion?);
|
public override bool CanConvert(Type t) => t == typeof(LinksUnion) || t == typeof(LinksUnion?);
|
||||||
@@ -752,7 +738,6 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
}
|
}
|
||||||
|
|
||||||
serializer.Serialize(writer, value.LinksClass);
|
serializer.Serialize(writer, value.LinksClass);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly LinksUnionConverter Singleton = new LinksUnionConverter();
|
public static readonly LinksUnionConverter Singleton = new LinksUnionConverter();
|
||||||
@@ -788,7 +773,6 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
|
|
||||||
var value = (long)untypedValue;
|
var value = (long)untypedValue;
|
||||||
serializer.Serialize(writer, value.ToString());
|
serializer.Serialize(writer, value.ToString());
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly ParseStringConverter Singleton = new ParseStringConverter();
|
public static readonly ParseStringConverter Singleton = new ParseStringConverter();
|
||||||
|
Reference in New Issue
Block a user