< Summary - Jellyfin

Information
Class: Jellyfin.Server.Filters.RetryOnTemporarilyUnavailableFilter
Assembly: jellyfin
File(s): /srv/git/jellyfin/Jellyfin.Server/Filters/RetryOnTemporarilyUnavailableFilter.cs
Line coverage
100%
Covered lines: 40
Uncovered lines: 0
Coverable lines: 40
Total lines: 51
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 3/16/2026 - 12:14:00 AM Line coverage: 100% (40/40) Branch coverage: 50% (1/2) Total lines: 51 3/16/2026 - 12:14:00 AM Line coverage: 100% (40/40) Branch coverage: 50% (1/2) Total lines: 51

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Apply(...)50%22100%

File(s)

/srv/git/jellyfin/Jellyfin.Server/Filters/RetryOnTemporarilyUnavailableFilter.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using Microsoft.OpenApi;
 3using Swashbuckle.AspNetCore.SwaggerGen;
 4
 5namespace Jellyfin.Server.Filters;
 6
 7internal class RetryOnTemporarilyUnavailableFilter : IOperationFilter
 8{
 9    public void Apply(OpenApiOperation operation, OperationFilterContext context)
 10    {
 36411        operation.Responses?.TryAdd(
 36412            "503",
 36413            new OpenApiResponse
 36414            {
 36415                Description = "The server is currently starting or is temporarily not available.",
 36416                Headers = new Dictionary<string, IOpenApiHeader>
 36417                {
 36418                    {
 36419                        "Retry-After", new OpenApiHeader
 36420                        {
 36421                            AllowEmptyValue = true,
 36422                            Required = false,
 36423                            Description = "A hint for when to retry the operation in full seconds.",
 36424                            Schema = new OpenApiSchema
 36425                            {
 36426                                Type = JsonSchemaType.Integer,
 36427                                Format = "int32"
 36428                            }
 36429                        }
 36430                    },
 36431                    {
 36432                        "Message", new OpenApiHeader
 36433                        {
 36434                            AllowEmptyValue = true,
 36435                            Required = false,
 36436                            Description = "A short plain-text reason why the server is not available.",
 36437                            Schema = new OpenApiSchema
 36438                            {
 36439                                Type = JsonSchemaType.String,
 36440                                Format = "text"
 36441                            }
 36442                        }
 36443                    }
 36444                },
 36445                Content = new Dictionary<string, OpenApiMediaType>()
 36446                {
 36447                    { "text/html", new OpenApiMediaType() }
 36448                }
 36449            });
 36450    }
 51}