From 3d62bdeb2efe90708298bbb79b23d15b47ec2ae9 Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 13 Mar 2021 03:21:18 +0100 Subject: [PATCH] Rework JSON validation --- .github/studios.schema.json | 143 +++++++++++++----------- .github/workflows/build_and_release.yml | 2 +- .github/workflows/validate_json.yml | 2 +- 3 files changed, 78 insertions(+), 69 deletions(-) diff --git a/.github/studios.schema.json b/.github/studios.schema.json index deeefa0..a04baac 100644 --- a/.github/studios.schema.json +++ b/.github/studios.schema.json @@ -1,72 +1,81 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Jellyfin studio artwork", - "description": "A set of artwork for studios, used by Jellyfin", - "type": "array", - "items": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Jellyfin studio artwork", + "description": "A set of artwork for studios, used by Jellyfin", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "Standard name of the studio, network or label in English", + "type": "string" + }, + "providers": { "type": "object", + "description": "Identifiers for various metadata providers", "properties": { - "name": { - "description": "Standard name of the studio, network or label in English", - "type": "string" - }, - "providers": { - "type": "object", - "description": "Identifiers for various metadata providers", - "properties": { - "tvdb": { - "description": "Identifier of the network on TVDB", - "type": "string" - }, - "tmdb": { - "description": "Identifier of the network or studio on TheMovieDB", - "type": "string" - }, - "imdb": { - "description": "Identifier of the company on IMDB", - "type": "string" - }, - "musicbrainz": { - "description": "Identifier of the label on MusicBrainz", - "type": "string" - }, - "anidb": { - "description": "Identifier of the studio on AniDB", - "type": "string" - }, - "anilist": { - "description": "Identifier of the studio on AniList", - "type": "string" - }, - "additionalProperties": true - } - }, - "artwork": { - "type": "object", - "properties": { - "primary": { - "type": "string" - }, - "thumb": { - "type": "string" - }, - "logo": { - "type": "string" - }, - "backdrop": { - "type": "string" - } - }, - "required": [ - "primary", - "thumb" - ] + "tvdb": { + "description": "Identifier of the network on TVDB", + "type": "string" + }, + "tmdb": { + "description": "Identifier of the network or studio on TheMovieDB", + "type": "string" + }, + "imdb": { + "description": "Identifier of the company on IMDB", + "type": "string" + }, + "musicbrainz": { + "description": "Identifier of the label on MusicBrainz", + "type": "string" + }, + "anidb": { + "description": "Identifier of the studio on AniDB", + "type": "string" + }, + "anilist": { + "description": "Identifier of the studio on AniList", + "type": "string" + }, + "additionalProperties": true + } + }, + "artwork": { + "type": "object", + "properties": { + "primary": { + "type": "array", + "items": { + "type": "string", + "enum": ["webp", "svg"] + } + }, + "thumb": { + "type": "array", + "items": { + "type": "string", + "enum": ["webp", "svg"] + } + }, + "logo": { + "type": "array", + "items": { + "type": "string", + "enum": ["webp", "svg"] + } + }, + "backdrop": { + "type": "array", + "items": { + "type": "string", + "enum": ["webp", "svg"] } + } }, - "required": [ - "name", - "providers", - "artwork" - ] - } -} \ No newline at end of file + "required": ["primary", "thumb"] + } + }, + "required": ["name", "providers", "artwork"] + } +} diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index d4bff6a..e7a9718 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -35,7 +35,7 @@ jobs: run: cd dist; zip -r -D ../release.zip *; cd .. - uses: "marvinpinto/action-automatic-releases@latest" with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" + repo_token: "${{ secrets.GH_TOKEN }}" automatic_release_tag: "latest" prerelease: false files: | diff --git a/.github/workflows/validate_json.yml b/.github/workflows/validate_json.yml index 0b405ff..a4a325c 100644 --- a/.github/workflows/validate_json.yml +++ b/.github/workflows/validate_json.yml @@ -16,4 +16,4 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} json_schema: .github/studios.schema.json - json_path_pattern: studios.json + json_path_pattern: studios/.*/studio.json$