diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2023-02-15 22:40:07 +0100 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2023-02-15 22:40:07 +0100 |
| commit | 3a91c37283eb633e7e55df78b8017a5a492923b6 (patch) | |
| tree | 4e22db9a5234c63370195992a28c64891d7a6cc1 /Jellyfin.Api/Formatters/XmlOutputFormatter.cs | |
| parent | 4eba16c6726564b159e395e188ec89f69d990e52 (diff) | |
| parent | 3fe64f69b747f39a6505e4fad1bbd6eaf63cecc4 (diff) | |
Merge branch 'master' into network-rewrite
Diffstat (limited to 'Jellyfin.Api/Formatters/XmlOutputFormatter.cs')
| -rw-r--r-- | Jellyfin.Api/Formatters/XmlOutputFormatter.cs | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/Jellyfin.Api/Formatters/XmlOutputFormatter.cs b/Jellyfin.Api/Formatters/XmlOutputFormatter.cs index df8b1650b..d5dea0f09 100644 --- a/Jellyfin.Api/Formatters/XmlOutputFormatter.cs +++ b/Jellyfin.Api/Formatters/XmlOutputFormatter.cs @@ -4,30 +4,29 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Formatters; -namespace Jellyfin.Api.Formatters +namespace Jellyfin.Api.Formatters; + +/// <summary> +/// Xml output formatter. +/// </summary> +public class XmlOutputFormatter : TextOutputFormatter { /// <summary> - /// Xml output formatter. + /// Initializes a new instance of the <see cref="XmlOutputFormatter"/> class. /// </summary> - public class XmlOutputFormatter : TextOutputFormatter + public XmlOutputFormatter() { - /// <summary> - /// Initializes a new instance of the <see cref="XmlOutputFormatter"/> class. - /// </summary> - public XmlOutputFormatter() - { - SupportedMediaTypes.Clear(); - SupportedMediaTypes.Add(MediaTypeNames.Text.Xml); + SupportedMediaTypes.Clear(); + SupportedMediaTypes.Add(MediaTypeNames.Text.Xml); - SupportedEncodings.Add(Encoding.UTF8); - SupportedEncodings.Add(Encoding.Unicode); - } + SupportedEncodings.Add(Encoding.UTF8); + SupportedEncodings.Add(Encoding.Unicode); + } - /// <inheritdoc /> - public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) - { - var stringResponse = context.Object?.ToString(); - return stringResponse is null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse); - } + /// <inheritdoc /> + public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) + { + var stringResponse = context.Object?.ToString(); + return stringResponse is null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse); } } |
