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.
Lidarr/src/NzbDrone.Core/Datastore/Converters/PrimaryAlbumTypeIntConverte...

22 lines
657 B

using System;
using System.Text.Json;
using System.Text.Json.Serialization;
using NzbDrone.Core.Music;
namespace NzbDrone.Core.Datastore.Converters
{
public class PrimaryAlbumTypeIntConverter : JsonConverter<PrimaryAlbumType>
{
public override PrimaryAlbumType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var item = reader.GetInt32();
return (PrimaryAlbumType)item;
}
public override void Write(Utf8JsonWriter writer, PrimaryAlbumType value, JsonSerializerOptions options)
{
writer.WriteNumberValue((int)value);
}
}
}