mirror of https://github.com/Radarr/Radarr
24 lines
604 B
C#
24 lines
604 B
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using Nancy;
|
|
using Nancy.Responses.Negotiation;
|
|
using NzbDrone.Common.Serializer;
|
|
|
|
namespace Radarr.Http.Extensions
|
|
{
|
|
public class NancyJsonSerializer : ISerializer
|
|
{
|
|
public bool CanSerialize(MediaRange contentType)
|
|
{
|
|
return contentType == "application/json";
|
|
}
|
|
|
|
public void Serialize<TModel>(MediaRange contentType, TModel model, Stream outputStream)
|
|
{
|
|
Json.Serialize(model, outputStream);
|
|
}
|
|
|
|
public IEnumerable<string> Extensions { get; private set; }
|
|
}
|
|
}
|