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
667 B
22 lines
667 B
using System;
|
|
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
using NzbDrone.Core.Music;
|
|
|
|
namespace NzbDrone.Core.Datastore.Converters
|
|
{
|
|
public class SecondaryAlbumTypeIntConverter : JsonConverter<SecondaryAlbumType>
|
|
{
|
|
public override SecondaryAlbumType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
|
{
|
|
var item = reader.GetInt32();
|
|
return (SecondaryAlbumType)item;
|
|
}
|
|
|
|
public override void Write(Utf8JsonWriter writer, SecondaryAlbumType value, JsonSerializerOptions options)
|
|
{
|
|
writer.WriteNumberValue((int)value);
|
|
}
|
|
}
|
|
}
|