You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
642 B
22 lines
642 B
using System;
|
|
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
using NzbDrone.Core.Music;
|
|
|
|
namespace NzbDrone.Core.Datastore.Converters
|
|
{
|
|
public class ReleaseStatusIntConverter : JsonConverter<ReleaseStatus>
|
|
{
|
|
public override ReleaseStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
|
{
|
|
var item = reader.GetInt32();
|
|
return (ReleaseStatus)item;
|
|
}
|
|
|
|
public override void Write(Utf8JsonWriter writer, ReleaseStatus value, JsonSerializerOptions options)
|
|
{
|
|
writer.WriteNumberValue((int)value);
|
|
}
|
|
}
|
|
}
|