diff --git a/.github/workflows/metadata-validation.yml b/.github/workflows/metadata-validation.yml new file mode 100644 index 000000000..88546450d --- /dev/null +++ b/.github/workflows/metadata-validation.yml @@ -0,0 +1,25 @@ +name: Validate Metadata JSON + +on: + push: + paths: + - metadata.json + - metadata.schema.json + - .github/workflows/metadata-validation.yml + pull_request: + paths: + - metadata.json + - metadata.schema.json + - .github/workflows/metadata-validation.yml + +jobs: + validate: + runs-on: ubuntu-latest + name: Validate metadata.json + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + - run: pip install jsonschema + - run: jsonschema -i metadata.json metadata.schema.json diff --git a/docs/json/radarr/extras.json b/docs/json/radarr/extras.json new file mode 100644 index 000000000..62f7b3423 --- /dev/null +++ b/docs/json/radarr/extras.json @@ -0,0 +1,17 @@ +{ + "trash_id": "0a3f082873eb454bde444150b70253cc", + "trash_score": "-10000", + "name": "Extras", + "includeCustomFormatWhenRenaming": false, + "specifications": [ + { + "name": "Extras", + "implementation": "ReleaseTitleSpecification", + "negate": false, + "required": true, + "fields": { + "value": "(?<=\\b[12]\\d{3}\\b).*\\b(Extras)\\b" + } + } + ] +} diff --git a/metadata.schema.json b/metadata.schema.json index 2f94ffbbc..ecc767d91 100644 --- a/metadata.schema.json +++ b/metadata.schema.json @@ -1,5 +1,5 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", + "$schema": "https://json-schema.org/draft-07/schema", "$id": "https://raw.githubusercontent.com/TRaSH-/Guides/master/metadata.schema.json", "type": "object", "additionalProperties": false, @@ -9,8 +9,8 @@ "type": "object", "additionalProperties": false, "properties": { - "radarr": "#/$defs/radarr", - "sonarr": "#/$defs/sonarr" + "radarr": { "$ref": "#/$defs/radarr" }, + "sonarr": { "$ref": "#/$defs/sonarr" } } } }, @@ -27,14 +27,14 @@ "type": "object", "additionalProperties": false, "properties": { - "custom_formats": "#/$defs/custom_formats" + "custom_formats": { "$ref": "#/$defs/custom_formats" } } }, "sonarr": { "type": "object", "additionalProperties": false, "properties": { - "release_profiles": "#/$defs/release_profiles" + "release_profiles": { "$ref": "#/$defs/release_profiles" } } } }