< Summary - Jellyfin

Information
Class: Jellyfin.Server.Filters.RetryOnTemporarlyUnavailableFilter
Assembly: jellyfin
File(s): /srv/git/jellyfin/Jellyfin.Server/Filters/RetryOnTemporarlyUnavailableFilter.cs
Line coverage
100%
Covered lines: 23
Uncovered lines: 0
Coverable lines: 23
Total lines: 36
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

Metrics

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

File(s)

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

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Net.Http.Headers;
 4using Microsoft.OpenApi.Models;
 5using Swashbuckle.AspNetCore.SwaggerGen;
 6
 7namespace Jellyfin.Server.Filters;
 8
 9internal class RetryOnTemporarlyUnavailableFilter : IOperationFilter
 10{
 11    public void Apply(OpenApiOperation operation, OperationFilterContext context)
 12    {
 38213        operation.Responses.Add("503", new OpenApiResponse()
 38214        {
 38215            Description = "The server is currently starting or is temporarly not available.",
 38216            Headers = new Dictionary<string, OpenApiHeader>()
 38217            {
 38218                {
 38219                    "Retry-After",
 38220                    new() { AllowEmptyValue = true, Required = false, Description = "A hint for when to retry the operat
 38221                },
 38222                {
 38223                    "Message",
 38224                    new() { AllowEmptyValue = true, Required = false, Description = "A short plain-text reason why the s
 38225                }
 38226            },
 38227            Content = new Dictionary<string, OpenApiMediaType>()
 38228            {
 38229                {
 38230                    "text/html",
 38231                    new OpenApiMediaType()
 38232                }
 38233            }
 38234        });
 38235    }
 36}