diff --git a/ErsatzTV/Startup.cs b/ErsatzTV/Startup.cs index b9ca236f0..39ced9500 100644 --- a/ErsatzTV/Startup.cs +++ b/ErsatzTV/Startup.cs @@ -4,6 +4,7 @@ using System.IO.Abstractions; using System.Reflection; using System.Runtime.InteropServices; using System.Text; +using System.Text.Json.Serialization; using System.Threading.Channels; using BlazorSortable; using Bugsnag.AspNet.Core; @@ -177,6 +178,8 @@ public class Startup }); }); + services.ConfigureHttpJsonOptions(o => o.SerializerOptions.NumberHandling = JsonNumberHandling.Strict); + OidcHelper.Init(Configuration); JwtHelper.Init(Configuration); SearchHelper.Init(Configuration); diff --git a/ErsatzTV/wwwroot/openapi/scripted-schedule-tagged.json b/ErsatzTV/wwwroot/openapi/scripted-schedule-tagged.json index 2c4902e81..c9c8e262e 100644 --- a/ErsatzTV/wwwroot/openapi/scripted-schedule-tagged.json +++ b/ErsatzTV/wwwroot/openapi/scripted-schedule-tagged.json @@ -1768,11 +1768,7 @@ "description": "The 'key' for the content" }, "count": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "The number of items to skip", "format": "int32" } @@ -1791,20 +1787,12 @@ "description": "The 'key' for the content" }, "season": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "The season number", "format": "int32" }, "episode": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "The episode number", "format": "int32" } @@ -1901,11 +1889,7 @@ "type": "string" }, "milliseconds": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "Duration in milliseconds", "format": "int64" } @@ -1923,11 +1907,7 @@ "description": "The 'key' for the content" }, "count": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" } } @@ -1974,11 +1954,7 @@ "description": "The 'key' for the content that should be added" }, "count": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "fillerKind": { @@ -2027,11 +2003,7 @@ "description": "Controls whether content will be trimmed to exactly fit the specified duration" }, "discardAttempts": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "When trim is false, this is the number of times to discard items from the collection to find something that fits in the remaining duration", "format": "int32" }, @@ -2074,11 +2046,7 @@ "description": "The 'key' for the content that should be added" }, "minutes": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "The minutes interval", "format": "int32" }, @@ -2094,11 +2062,7 @@ "description": "Controls whether content will be trimmed to exactly fit the specified interval" }, "discardAttempts": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "When trim is false, this is the number of times to discard items from the collection to find something that fits in the remaining interval", "format": "int32" }, @@ -2160,11 +2124,7 @@ "description": "Controls whether content will be trimmed to exactly fit until the specified time" }, "discardAttempts": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "When trim is false, this is the number of times to discard items from the collection to find something that fits until the specified time", "format": "int32" }, @@ -2223,11 +2183,7 @@ "description": "Controls whether content will be trimmed to exactly fit until the specified time" }, "discardAttempts": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "When trim is false, this is the number of times to discard items from the collection to find something that fits until the specified time", "format": "int32" }, diff --git a/ErsatzTV/wwwroot/openapi/scripted-schedule.json b/ErsatzTV/wwwroot/openapi/scripted-schedule.json index 8bbf2fa1d..d70777bc0 100644 --- a/ErsatzTV/wwwroot/openapi/scripted-schedule.json +++ b/ErsatzTV/wwwroot/openapi/scripted-schedule.json @@ -1768,11 +1768,7 @@ "description": "The 'key' for the content" }, "count": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "The number of items to skip", "format": "int32" } @@ -1791,20 +1787,12 @@ "description": "The 'key' for the content" }, "season": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "The season number", "format": "int32" }, "episode": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "The episode number", "format": "int32" } @@ -1901,11 +1889,7 @@ "type": "string" }, "milliseconds": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "Duration in milliseconds", "format": "int64" } @@ -1923,11 +1907,7 @@ "description": "The 'key' for the content" }, "count": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" } } @@ -1974,11 +1954,7 @@ "description": "The 'key' for the content that should be added" }, "count": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "fillerKind": { @@ -2027,11 +2003,7 @@ "description": "Controls whether content will be trimmed to exactly fit the specified duration" }, "discardAttempts": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "When trim is false, this is the number of times to discard items from the collection to find something that fits in the remaining duration", "format": "int32" }, @@ -2074,11 +2046,7 @@ "description": "The 'key' for the content that should be added" }, "minutes": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "The minutes interval", "format": "int32" }, @@ -2094,11 +2062,7 @@ "description": "Controls whether content will be trimmed to exactly fit the specified interval" }, "discardAttempts": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "When trim is false, this is the number of times to discard items from the collection to find something that fits in the remaining interval", "format": "int32" }, @@ -2160,11 +2124,7 @@ "description": "Controls whether content will be trimmed to exactly fit until the specified time" }, "discardAttempts": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "When trim is false, this is the number of times to discard items from the collection to find something that fits until the specified time", "format": "int32" }, @@ -2223,11 +2183,7 @@ "description": "Controls whether content will be trimmed to exactly fit until the specified time" }, "discardAttempts": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "description": "When trim is false, this is the number of times to discard items from the collection to find something that fits until the specified time", "format": "int32" }, diff --git a/ErsatzTV/wwwroot/openapi/v1.json b/ErsatzTV/wwwroot/openapi/v1.json index 920aca816..5c0bd5eb4 100644 --- a/ErsatzTV/wwwroot/openapi/v1.json +++ b/ErsatzTV/wwwroot/openapi/v1.json @@ -193,7 +193,6 @@ "in": "path", "required": true, "schema": { - "pattern": "^-?(?:0|[1-9]\\d*)$", "type": "integer", "format": "int32" } @@ -218,7 +217,6 @@ "in": "path", "required": true, "schema": { - "pattern": "^-?(?:0|[1-9]\\d*)$", "type": "integer", "format": "int32" } @@ -243,7 +241,6 @@ "in": "path", "required": true, "schema": { - "pattern": "^-?(?:0|[1-9]\\d*)$", "type": "integer", "format": "int32" } @@ -546,7 +543,6 @@ "in": "path", "required": true, "schema": { - "pattern": "^-?(?:0|[1-9]\\d*)$", "type": "integer", "format": "int32" } @@ -605,11 +601,7 @@ "type": "object", "properties": { "id": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "number": { @@ -652,11 +644,7 @@ "type": "object", "properties": { "apiVersion": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "appVersion": { @@ -704,11 +692,7 @@ ] }, "threadCount": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "hardwareAcceleration": { @@ -730,20 +714,14 @@ ] }, "qsvExtraHardwareFrames": { - "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "null", - "integer", - "string" + "integer" ], "format": "int32" }, "resolutionId": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "scalingBehavior": { @@ -771,19 +749,11 @@ "$ref": "#/components/schemas/FFmpegProfileBitDepth" }, "videoBitrate": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "videoBufferSize": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "tonemapAlgorithm": { @@ -793,38 +763,22 @@ "$ref": "#/components/schemas/FFmpegProfileAudioFormat" }, "audioBitrate": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "audioBufferSize": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "normalizeLoudnessMode": { "$ref": "#/components/schemas/NormalizeLoudnessMode" }, "audioChannels": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "audioSampleRate": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "normalizeFramerate": { @@ -888,11 +842,7 @@ "type": "object", "properties": { "id": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "name": { @@ -902,11 +852,7 @@ ] }, "threadCount": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "hardwareAcceleration": { @@ -928,11 +874,9 @@ ] }, "qsvExtraHardwareFrames": { - "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "null", - "integer", - "string" + "integer" ], "format": "int32" }, @@ -967,19 +911,11 @@ "$ref": "#/components/schemas/FFmpegProfileBitDepth" }, "videoBitrate": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "videoBufferSize": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "tonemapAlgorithm": { @@ -989,38 +925,22 @@ "$ref": "#/components/schemas/FFmpegProfileAudioFormat" }, "audioBitrate": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "audioBufferSize": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "normalizeLoudnessMode": { "$ref": "#/components/schemas/NormalizeLoudnessMode" }, "audioChannels": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "audioSampleRate": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "normalizeFramerate": { @@ -1129,11 +1049,7 @@ "type": "object", "properties": { "id": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "name": { @@ -1143,19 +1059,11 @@ ] }, "width": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "height": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "isCustom": { @@ -1197,11 +1105,7 @@ "type": "object", "properties": { "id": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "name": { @@ -1250,11 +1154,7 @@ "type": "object", "properties": { "fFmpegProfileId": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "name": { @@ -1264,11 +1164,7 @@ ] }, "threadCount": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "hardwareAcceleration": { @@ -1290,20 +1186,14 @@ ] }, "qsvExtraHardwareFrames": { - "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "null", - "integer", - "string" + "integer" ], "format": "int32" }, "resolutionId": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "scalingBehavior": { @@ -1331,19 +1221,11 @@ "$ref": "#/components/schemas/FFmpegProfileBitDepth" }, "videoBitrate": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "videoBufferSize": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "tonemapAlgorithm": { @@ -1353,38 +1235,22 @@ "$ref": "#/components/schemas/FFmpegProfileAudioFormat" }, "audioBitrate": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "audioBufferSize": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "normalizeLoudnessMode": { "$ref": "#/components/schemas/NormalizeLoudnessMode" }, "audioChannels": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "audioSampleRate": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "normalizeFramerate": { @@ -1404,11 +1270,7 @@ "type": "object", "properties": { "id": { - "pattern": "^-?(?:0|[1-9]\\d*)$", - "type": [ - "integer", - "string" - ], + "type": "integer", "format": "int32" }, "name": {