diff options
| author | Cody Robibero <cody@robibe.ro> | 2022-03-23 08:32:33 -0600 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2022-03-23 08:32:33 -0600 |
| commit | 72cfa6d7c94dbae58e29a0abc639eb369ff7527f (patch) | |
| tree | 6223491969dfd1dfee64e0f17d90b98a8d71768a | |
| parent | 7fb21132dd8840dcdac48d81c14c822d16708477 (diff) | |
Fix spec generation for TranscodeReason
| -rw-r--r-- | Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs index fa98fda69..3df8481fd 100644 --- a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs @@ -29,6 +29,7 @@ using Jellyfin.Server.Filters; using Jellyfin.Server.Formatters; using MediaBrowser.Common.Net; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Session; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Builder; @@ -428,6 +429,17 @@ namespace Jellyfin.Server.Extensions Nullable = true } }); + + // Manually describe Flags enum. + options.MapType<TranscodeReason>(() => + new OpenApiSchema + { + Type = "string", + Enum = Enum.GetNames<TranscodeReason>() + .Select(e => new OpenApiString(e)) + .Cast<IOpenApiAny>() + .ToArray() + }); } } } |
