< 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
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 11/7/2025 - 12:11:55 AM Line coverage: 100% (40/40) Total lines: 51

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Apply(...)100%11100%

File(s)

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

#LineLine coverage
 1using System.Collections.Generic;
 2using Microsoft.OpenApi.Models;
 3using Swashbuckle.AspNetCore.SwaggerGen;
 4
 5namespace Jellyfin.Server.Filters;
 6
 7internal class RetryOnTemporarilyUnavailableFilter : IOperationFilter
 8{
 9    public void Apply(OpenApiOperation operation, OperationFilterContext context)
 10    {
 38711        operation.Responses.TryAdd(
 38712            "503",
 38713            new OpenApiResponse
 38714            {
 38715                Description = "The server is currently starting or is temporarily not available.",
 38716                Headers = new Dictionary<string, OpenApiHeader>
 38717                {
 38718                    {
 38719                        "Retry-After", new OpenApiHeader
 38720                        {
 38721                            AllowEmptyValue = true,
 38722                            Required = false,
 38723                            Description = "A hint for when to retry the operation in full seconds.",
 38724                            Schema = new OpenApiSchema
 38725                            {
 38726                                Type = "integer",
 38727                                Format = "int32"
 38728                            }
 38729                        }
 38730                    },
 38731                    {
 38732                        "Message", new OpenApiHeader
 38733                        {
 38734                            AllowEmptyValue = true,
 38735                            Required = false,
 38736                            Description = "A short plain-text reason why the server is not available.",
 38737                            Schema = new OpenApiSchema
 38738                            {
 38739                                Type = "string",
 38740                                Format = "text"
 38741                            }
 38742                        }
 38743                    }
 38744                },
 38745                Content = new Dictionary<string, OpenApiMediaType>()
 38746                {
 38747                    { "text/html", new OpenApiMediaType() }
 38748                }
 38749            });
 38750    }
 51}