diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2026-02-27 13:27:57 +0100 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2026-02-27 13:27:57 +0100 |
| commit | bd6bf6ee3c33c8f322740de019f78dee998cca0f (patch) | |
| tree | 14639a570bd4e59ed3e99432b04e0f8bafa6f985 /Jellyfin.Server/Filters/FileResponseFilter.cs | |
| parent | 2d0d497961a7ca990384bd180f381824d5591cb8 (diff) | |
| parent | bdfb6edfa3bb0ed1b4876edb3c1cf8f42b7486de (diff) | |
Merge remote-tracking branch 'upstream/master' into perf-rebased
Diffstat (limited to 'Jellyfin.Server/Filters/FileResponseFilter.cs')
| -rw-r--r-- | Jellyfin.Server/Filters/FileResponseFilter.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Jellyfin.Server/Filters/FileResponseFilter.cs b/Jellyfin.Server/Filters/FileResponseFilter.cs index cd0acadf32..64aea62519 100644 --- a/Jellyfin.Server/Filters/FileResponseFilter.cs +++ b/Jellyfin.Server/Filters/FileResponseFilter.cs @@ -1,7 +1,7 @@ using System; using System.Linq; using Jellyfin.Api.Attributes; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; namespace Jellyfin.Server.Filters @@ -14,7 +14,7 @@ namespace Jellyfin.Server.Filters { Schema = new OpenApiSchema { - Type = "string", + Type = JsonSchemaType.String, Format = "binary" } }; @@ -22,6 +22,11 @@ namespace Jellyfin.Server.Filters /// <inheritdoc /> public void Apply(OpenApiOperation operation, OperationFilterContext context) { + if (operation.Responses is null) + { + return; + } + foreach (var attribute in context.ApiDescription.ActionDescriptor.EndpointMetadata) { if (attribute is ProducesFileAttribute producesFileAttribute) @@ -31,7 +36,7 @@ namespace Jellyfin.Server.Filters .FirstOrDefault(o => o.Key.Equals(SuccessCode, StringComparison.Ordinal)); // Operation doesn't have a response. - if (response.Value is null) + if (response.Value?.Content is null) { continue; } |
