aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Filters/FileResponseFilter.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2026-04-24 19:00:19 +0200
committerGitHub <noreply@github.com>2026-04-24 19:00:19 +0200
commita183fce142a47db3b2b9faa1e0f2863f0d56e5a1 (patch)
tree8637cf347d573917242a3c5546baee33028825a3 /Jellyfin.Server/Filters/FileResponseFilter.cs
parentd1f242bc097b1530de27d5e74f303ff06096c294 (diff)
parentb1e2419c6593a3aa4c8df3778831a3214ae5a1c0 (diff)
Merge branch 'master' into Preservation-of-Watched-Status-on-Re-watch
Diffstat (limited to 'Jellyfin.Server/Filters/FileResponseFilter.cs')
-rw-r--r--Jellyfin.Server/Filters/FileResponseFilter.cs11
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;
}