add yaml playout pre_roll instruction (#2228)

* add yaml playout pre_roll instruction

* add basic yaml validation

* validate all yaml playout content items

* fix yaml to json conversion

* update changelog
This commit is contained in:
Jason Dove
2025-08-01 15:20:10 +00:00
committed by GitHub
parent f768093df7
commit 093abf7ad8
34 changed files with 12781 additions and 27 deletions
+1
View File
@@ -81,6 +81,7 @@
<EmbeddedResource Include="Resources\Templates\_musicVideo.sbntxt" />
<EmbeddedResource Include="Resources\Templates\_otherVideo.sbntxt" />
<EmbeddedResource Include="Resources\Templates\_song.sbntxt" />
<EmbeddedResource Include="Resources\yaml-playout.schema.json" />
</ItemGroup>
<ItemGroup>
+146
View File
@@ -0,0 +1,146 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ersatztv.org/yaml-playout.schema.json",
"title": "YAML Playout",
"description": "An ErsatzTV YAML playout definition",
"type": "object",
"properties": {
"content": {
"description": "Content definitions",
"type": "array",
"items": {
"oneOf": [
{ "$ref": "#/$defs/showContent" },
{ "$ref": "#/$defs/searchContent" },
{ "$ref": "#/$defs/collectionContent" },
{ "$ref": "#/$defs/multiCollectionContent" },
{ "$ref": "#/$defs/smartCollectionContent" },
{ "$ref": "#/$defs/playlistContent" },
{ "$ref": "#/$defs/marathonContent" }
]
},
"minItems": 1
},
"sequence": {
"description": "Sequence definitions",
"type": "array"
},
"reset": {
"description": "Reset instructions",
"type": "array"
},
"playout": {
"description": "Playout instructions",
"type": "array",
"minItems": 1
}
},
"required": [ "content", "playout" ],
"additionalProperties": false,
"$defs": {
"showContent": {
"type": "object",
"properties": {
"show": { "type": "null" },
"key": { "type": "string" },
"guids": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"source": { "type": "string" },
"value": { "type": "string" }
},
"required": [ "source", "value" ],
"additionalProperties": false
}
},
"order": { "enum": [ "chronological", "shuffle" ] }
},
"required": [ "show", "key", "guids", "order" ],
"additionalProperties": false
},
"searchContent": {
"type": "object",
"properties": {
"search": { "type": "null" },
"key": { "type": "string" },
"query": { "type": "string" },
"order": { "enum": [ "chronological", "shuffle" ] }
},
"required": [ "search", "key", "query", "order" ],
"additionalProperties": false
},
"collectionContent": {
"type": "object",
"properties": {
"collection": { "type": "string" },
"key": { "type": "string" },
"order": { "enum": [ "chronological", "shuffle" ] }
},
"required": [ "collection", "key", "order" ],
"additionalProperties": false
},
"multiCollectionContent": {
"type": "object",
"properties": {
"multi_collection": { "type": "string" },
"key": { "type": "string" },
"order": { "enum": [ "chronological", "shuffle" ] }
},
"required": [ "multi_collection", "key", "order" ],
"additionalProperties": false
},
"smartCollectionContent": {
"type": "object",
"properties": {
"smart_collection": { "type": "string" },
"key": { "type": "string" },
"order": { "enum": [ "chronological", "shuffle" ] }
},
"required": [ "smart_collection", "key", "order" ],
"additionalProperties": false
},
"playlistContent": {
"type": "object",
"properties": {
"playlist": { "type": "string" },
"playlist_group": { "type": "string" },
"key": { "type": "string" }
},
"required": [ "playlist", "playlist_group", "key" ],
"additionalProperties": false
},
"marathonContent": {
"type": "object",
"properties": {
"marathon": { "type": "null" },
"key": { "type": "string" },
"guids": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"source": { "type": "string" },
"value": { "type": "string" }
},
"required": [ "source", "value" ],
"additionalProperties": false
}
},
"searches": {
"type": "array",
"items": { "type": "string" }
},
"group_by": { "enum": [ "show", "season", "artist", "album" ] },
"item_order": { "enum": [ "chronological", "shuffle" ] },
"play_all_items": { "type": "boolean" },
"shuffle_groups": { "type": "boolean" }
},
"required": [ "marathon", "key" ],
"additionalProperties": false
}
}
}
@@ -24,6 +24,7 @@ public class ResourceExtractorService : BackgroundService
await ExtractResource(assembly, "song_progress_overlay.png", stoppingToken);
await ExtractResource(assembly, "song_progress_overlay_43.png", stoppingToken);
await ExtractResource(assembly, "ErsatzTV.png", stoppingToken);
await ExtractResource(assembly, "yaml-playout.schema.json", stoppingToken);
await ExtractFontResource(assembly, "Sen.ttf", stoppingToken);
await ExtractFontResource(assembly, "Roboto-Regular.ttf", stoppingToken);
+1
View File
@@ -730,6 +730,7 @@ public class Startup
services.AddScoped<IJellyfinSecretStore, JellyfinSecretStore>();
services.AddScoped<IEmbySecretStore, EmbySecretStore>();
services.AddScoped<IScriptEngine, ScriptEngine>();
services.AddScoped<IYamlScheduleValidator, YamlScheduleValidator>();
services.AddScoped<PlexEtag>();