From e31590879c3c97ee5e10b27c60894084700033da Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Sun, 30 Nov 2025 14:06:40 -0600 Subject: [PATCH] pass template data as json to stdin --- .../Streaming/Graphics/Script/ScriptElement.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ErsatzTV.Infrastructure/Streaming/Graphics/Script/ScriptElement.cs b/ErsatzTV.Infrastructure/Streaming/Graphics/Script/ScriptElement.cs index f9987cc89..fc70bcec0 100644 --- a/ErsatzTV.Infrastructure/Streaming/Graphics/Script/ScriptElement.cs +++ b/ErsatzTV.Infrastructure/Streaming/Graphics/Script/ScriptElement.cs @@ -1,5 +1,6 @@ using System.Buffers; using System.IO.Pipelines; +using System.Text.Json; using CliWrap; using ErsatzTV.Core; using ErsatzTV.Core.Graphics; @@ -80,9 +81,12 @@ public class ScriptElement(ScriptGraphicsElement scriptElement, ILogger logger) pixelFormat, SKAlphaType.Unpremul); + string json = JsonSerializer.Serialize(context.TemplateVariables); + Command command = Cli.Wrap(scriptElement.Command) .WithArguments(scriptElement.Arguments) .WithWorkingDirectory(FileSystemLayout.TempFilePoolFolder) + .WithStandardInputPipe(PipeSource.FromString(json)) .WithStandardOutputPipe(PipeTarget.ToStream(pipe.Writer.AsStream())); logger.LogDebug(