1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-03-28 18:04:19 -04:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Mark McDowall
3f45ff6991 Fixed: Unexpected languages stored in DB will be treated as Unknown
Closes #8482
2026-03-28 13:03:25 -07:00
2 changed files with 22 additions and 190 deletions

View File

@@ -34,8 +34,15 @@ namespace NzbDrone.Core.Datastore.Converters
public class LanguageIntConverter : JsonConverter<Language>
{
public override bool HandleNull => true;
public override Language Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.Null)
{
return Language.Unknown;
}
var item = reader.GetInt32();
return (Language)item;
}

View File

@@ -623,19 +623,12 @@
],
"parameters": [
{
"name": "skipTesting",
"name": "forceSave",
"in": "query",
"schema": {
"type": "boolean",
"default": false
}
},
{
"name": "skipValidation",
"in": "query",
"schema": {
"$ref": "#/components/schemas/SkipValidation"
}
}
],
"requestBody": {
@@ -677,19 +670,12 @@
}
},
{
"name": "skipTesting",
"name": "forceSave",
"in": "query",
"schema": {
"type": "boolean",
"default": false
}
},
{
"name": "skipValidation",
"in": "query",
"schema": {
"$ref": "#/components/schemas/SkipValidation"
}
}
],
"requestBody": {
@@ -793,10 +779,11 @@
],
"parameters": [
{
"name": "skipValidation",
"name": "forceTest",
"in": "query",
"schema": {
"$ref": "#/components/schemas/SkipValidation"
"type": "boolean",
"default": false
}
}
],
@@ -2071,19 +2058,12 @@
],
"parameters": [
{
"name": "skipTesting",
"name": "forceSave",
"in": "query",
"schema": {
"type": "boolean",
"default": false
}
},
{
"name": "skipValidation",
"in": "query",
"schema": {
"$ref": "#/components/schemas/SkipValidation"
}
}
],
"requestBody": {
@@ -2125,19 +2105,12 @@
}
},
{
"name": "skipTesting",
"name": "forceSave",
"in": "query",
"schema": {
"type": "boolean",
"default": false
}
},
{
"name": "skipValidation",
"in": "query",
"schema": {
"$ref": "#/components/schemas/SkipValidation"
}
}
],
"requestBody": {
@@ -2288,10 +2261,11 @@
],
"parameters": [
{
"name": "skipValidation",
"name": "forceTest",
"in": "query",
"schema": {
"$ref": "#/components/schemas/SkipValidation"
"type": "boolean",
"default": false
}
}
],
@@ -2392,101 +2366,6 @@
}
}
},
"/api/v5/settings/indexer": {
"get": {
"tags": [
"IndexerSettings"
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IndexerSettingsResource"
}
}
}
}
}
}
},
"/api/v5/settings/indexer/{id}": {
"put": {
"tags": [
"IndexerSettings"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IndexerSettingsResource"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/IndexerSettingsResource"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/IndexerSettingsResource"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/IndexerSettingsResource"
}
}
}
}
}
},
"get": {
"tags": [
"IndexerSettings"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IndexerSettingsResource"
}
}
}
}
}
}
},
"/api/v5/language": {
"get": {
"tags": [
@@ -2963,19 +2842,12 @@
],
"parameters": [
{
"name": "skipTesting",
"name": "forceSave",
"in": "query",
"schema": {
"type": "boolean",
"default": false
}
},
{
"name": "skipValidation",
"in": "query",
"schema": {
"$ref": "#/components/schemas/SkipValidation"
}
}
],
"requestBody": {
@@ -3017,19 +2889,12 @@
}
},
{
"name": "skipTesting",
"name": "forceSave",
"in": "query",
"schema": {
"type": "boolean",
"default": false
}
},
{
"name": "skipValidation",
"in": "query",
"schema": {
"$ref": "#/components/schemas/SkipValidation"
}
}
],
"requestBody": {
@@ -3133,10 +2998,11 @@
],
"parameters": [
{
"name": "skipValidation",
"name": "forceTest",
"in": "query",
"schema": {
"$ref": "#/components/schemas/SkipValidation"
"type": "boolean",
"default": false
}
}
],
@@ -7825,32 +7691,6 @@
},
"additionalProperties": false
},
"IndexerSettingsResource": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"minimumAge": {
"type": "integer",
"format": "int32"
},
"retention": {
"type": "integer",
"format": "int32"
},
"maximumSize": {
"type": "integer",
"format": "int32"
},
"rssSyncInterval": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
},
"Language": {
"type": "object",
"properties": {
@@ -8025,10 +7865,6 @@
"type": "string",
"nullable": true
},
"relativePath": {
"type": "string",
"nullable": true
},
"seriesId": {
"type": "integer",
"format": "int32"
@@ -10447,14 +10283,6 @@
],
"type": "string"
},
"SkipValidation": {
"enum": [
"none",
"warnings",
"all"
],
"type": "string"
},
"SortDirection": {
"enum": [
"default",
@@ -11037,9 +10865,6 @@
{
"name": "IndexerFlag"
},
{
"name": "IndexerSettings"
},
{
"name": "Language"
},