aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Formatters
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Server/Formatters')
-rw-r--r--Jellyfin.Server/Formatters/CamelCaseJsonProfileFormatter.cs21
-rw-r--r--Jellyfin.Server/Formatters/CssOutputFormatter.cs36
-rw-r--r--Jellyfin.Server/Formatters/PascalCaseJsonProfileFormatter.cs24
-rw-r--r--Jellyfin.Server/Formatters/XmlOutputFormatter.cs33
4 files changed, 0 insertions, 114 deletions
diff --git a/Jellyfin.Server/Formatters/CamelCaseJsonProfileFormatter.cs b/Jellyfin.Server/Formatters/CamelCaseJsonProfileFormatter.cs
deleted file mode 100644
index ea8c5ecdb..000000000
--- a/Jellyfin.Server/Formatters/CamelCaseJsonProfileFormatter.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using Jellyfin.Extensions.Json;
-using Microsoft.AspNetCore.Mvc.Formatters;
-using Microsoft.Net.Http.Headers;
-
-namespace Jellyfin.Server.Formatters
-{
- /// <summary>
- /// Camel Case Json Profile Formatter.
- /// </summary>
- public class CamelCaseJsonProfileFormatter : SystemTextJsonOutputFormatter
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="CamelCaseJsonProfileFormatter"/> class.
- /// </summary>
- public CamelCaseJsonProfileFormatter() : base(JsonDefaults.CamelCaseOptions)
- {
- SupportedMediaTypes.Clear();
- SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(JsonDefaults.CamelCaseMediaType));
- }
- }
-}
diff --git a/Jellyfin.Server/Formatters/CssOutputFormatter.cs b/Jellyfin.Server/Formatters/CssOutputFormatter.cs
deleted file mode 100644
index cfc9d1ad3..000000000
--- a/Jellyfin.Server/Formatters/CssOutputFormatter.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Text;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc.Formatters;
-
-namespace Jellyfin.Server.Formatters
-{
- /// <summary>
- /// Css output formatter.
- /// </summary>
- public class CssOutputFormatter : TextOutputFormatter
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="CssOutputFormatter"/> class.
- /// </summary>
- public CssOutputFormatter()
- {
- SupportedMediaTypes.Add("text/css");
-
- SupportedEncodings.Add(Encoding.UTF8);
- SupportedEncodings.Add(Encoding.Unicode);
- }
-
- /// <summary>
- /// Write context object to stream.
- /// </summary>
- /// <param name="context">Writer context.</param>
- /// <param name="selectedEncoding">Unused. Writer encoding.</param>
- /// <returns>Write stream task.</returns>
- public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
- {
- var stringResponse = context.Object?.ToString();
- return stringResponse == null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse);
- }
- }
-}
diff --git a/Jellyfin.Server/Formatters/PascalCaseJsonProfileFormatter.cs b/Jellyfin.Server/Formatters/PascalCaseJsonProfileFormatter.cs
deleted file mode 100644
index 03ca7dda7..000000000
--- a/Jellyfin.Server/Formatters/PascalCaseJsonProfileFormatter.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System.Net.Mime;
-using Jellyfin.Extensions.Json;
-using Microsoft.AspNetCore.Mvc.Formatters;
-using Microsoft.Net.Http.Headers;
-
-namespace Jellyfin.Server.Formatters
-{
- /// <summary>
- /// Pascal Case Json Profile Formatter.
- /// </summary>
- public class PascalCaseJsonProfileFormatter : SystemTextJsonOutputFormatter
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="PascalCaseJsonProfileFormatter"/> class.
- /// </summary>
- public PascalCaseJsonProfileFormatter() : base(JsonDefaults.PascalCaseOptions)
- {
- SupportedMediaTypes.Clear();
- // Add application/json for default formatter
- SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(MediaTypeNames.Application.Json));
- SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(JsonDefaults.PascalCaseMediaType));
- }
- }
-}
diff --git a/Jellyfin.Server/Formatters/XmlOutputFormatter.cs b/Jellyfin.Server/Formatters/XmlOutputFormatter.cs
deleted file mode 100644
index be0baea2d..000000000
--- a/Jellyfin.Server/Formatters/XmlOutputFormatter.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Net.Mime;
-using System.Text;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc.Formatters;
-
-namespace Jellyfin.Server.Formatters
-{
- /// <summary>
- /// Xml output formatter.
- /// </summary>
- public class XmlOutputFormatter : TextOutputFormatter
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="XmlOutputFormatter"/> class.
- /// </summary>
- public XmlOutputFormatter()
- {
- SupportedMediaTypes.Clear();
- SupportedMediaTypes.Add(MediaTypeNames.Text.Xml);
-
- SupportedEncodings.Add(Encoding.UTF8);
- SupportedEncodings.Add(Encoding.Unicode);
- }
-
- /// <inheritdoc />
- public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
- {
- var stringResponse = context.Object?.ToString();
- return stringResponse == null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse);
- }
- }
-}