Browse Source

rework some scripted schedule model names (#2386)

pull/2387/head
Jason Dove 4 months ago committed by GitHub
parent
commit
e047812a68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ContentAll.cs
  2. 4
      ErsatzTV.Core/Api/ScriptedPlayout/ContentCollection.cs
  3. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ContentMarathon.cs
  4. 4
      ErsatzTV.Core/Api/ScriptedPlayout/ContentMultiCollection.cs
  5. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ContentPlaylist.cs
  6. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ContentSearch.cs
  7. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ContentShow.cs
  8. 4
      ErsatzTV.Core/Api/ScriptedPlayout/ContentSmartCollection.cs
  9. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ControlGraphicsOff.cs
  10. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ControlGraphicsOn.cs
  11. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ControlSkipItems.cs
  12. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ControlSkipToItem.cs
  13. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ControlStartEpgGroup.cs
  14. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ControlWaitUntil.cs
  15. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ControlWaitUntilExact.cs
  16. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ControlWatermarkOff.cs
  17. 2
      ErsatzTV.Core/Api/ScriptedPlayout/ControlWatermarkOn.cs
  18. 2
      ErsatzTV.Core/Api/ScriptedPlayout/PeekItemDuration.cs
  19. 2
      ErsatzTV.Core/Api/ScriptedPlayout/PlayoutContext.cs
  20. 2
      ErsatzTV.Core/Api/ScriptedPlayout/PlayoutCount.cs
  21. 2
      ErsatzTV.Core/Api/ScriptedPlayout/PlayoutDuration.cs
  22. 2
      ErsatzTV.Core/Api/ScriptedPlayout/PlayoutPadToNext.cs
  23. 2
      ErsatzTV.Core/Api/ScriptedPlayout/PlayoutPadUntil.cs
  24. 2
      ErsatzTV.Core/Api/ScriptedPlayout/PlayoutPadUntilExact.cs
  25. 68
      ErsatzTV/Controllers/Api/ScriptedScheduleController.cs
  26. 668
      ErsatzTV/wwwroot/openapi/scripted-schedule-tagged.json
  27. 668
      ErsatzTV/wwwroot/openapi/scripted-schedule.json
  28. 4
      scripts/scripted-schedules/entrypoint.py

2
ErsatzTV.Core/Api/ScriptedPlayout/AddAllRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ContentAll.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record AddAllRequestModel
public record ContentAll
{
[Description("The 'key' for the content that should be added")]
public string Content { get; set; }

4
ErsatzTV.Core/Api/ScriptedPlayout/AddCollectionRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ContentCollection.cs

@ -1,8 +1,10 @@ @@ -1,8 +1,10 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record AddCollectionRequestModel
[SuppressMessage("Naming", "CA1711:Identifiers should not have incorrect suffix")]
public record ContentCollection
{
[Description("Unique name used to reference this content throughout the scripted schedule")]
public string Key { get; init; }

2
ErsatzTV.Core/Api/ScriptedPlayout/AddMarathonRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ContentMarathon.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record AddMarathonRequestModel
public record ContentMarathon
{
[Description("Unique name used to reference this content throughout the scripted schedule")]
public string Key { get; set; }

4
ErsatzTV.Core/Api/ScriptedPlayout/AddMultiCollectionRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ContentMultiCollection.cs

@ -1,8 +1,10 @@ @@ -1,8 +1,10 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record AddMultiCollectionRequestModel
[SuppressMessage("Naming", "CA1711:Identifiers should not have incorrect suffix")]
public record ContentMultiCollection
{
[Description("Unique name used to reference this content throughout the scripted schedule")]
public string Key { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/AddPlaylistRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ContentPlaylist.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record AddPlaylistRequestModel
public record ContentPlaylist
{
[Description("Unique name used to reference this content throughout the scripted schedule")]
public string Key { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/AddSearchQueryRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ContentSearch.cs

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record AddSearchQueryRequestModel
public record ContentSearch
{
public string Key { get; set; }
public string Query { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/AddShowRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ContentShow.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record AddShowRequestModel
public record ContentShow
{
[Description("Unique name used to reference this content throughout the scripted schedule")]
public string Key { get; set; }

4
ErsatzTV.Core/Api/ScriptedPlayout/AddSmartCollectionRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ContentSmartCollection.cs

@ -1,8 +1,10 @@ @@ -1,8 +1,10 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record AddSmartCollectionRequestModel
[SuppressMessage("Naming", "CA1711:Identifiers should not have incorrect suffix")]
public record ContentSmartCollection
{
[Description("Unique name used to reference this content throughout the scripted schedule")]
public string Key { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/GraphicsOffRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ControlGraphicsOff.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record GraphicsOffRequestModel
public record ControlGraphicsOff
{
[Description("A list of graphics elements to turn off. All graphics elements will be turned off if this list is null or empty")]
public List<string> Graphics { get; set; } = [];

2
ErsatzTV.Core/Api/ScriptedPlayout/GraphicsOnRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ControlGraphicsOn.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record GraphicsOnRequestModel
public record ControlGraphicsOn
{
[Description("A list of graphics elements to turn on.")]
public List<string> Graphics { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/SkipItemsRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ControlSkipItems.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record SkipItemsRequestModel
public record ControlSkipItems
{
[Description("The 'key' for the content")]
public string Content { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/SkipToItemRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ControlSkipToItem.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record SkipToItemRequestModel
public record ControlSkipToItem
{
[Description("The 'key' for the content")]
public string Content { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/StartEpgGroupRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ControlStartEpgGroup.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record StartEpgGroupRequestModel
public record ControlStartEpgGroup
{
[Description("When true, will make a new EPG group. When false, will continue the existing EPG group.")]
public bool Advance { get; set; } = true;

2
ErsatzTV.Core/Api/ScriptedPlayout/WaitUntilRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ControlWaitUntil.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record WaitUntilRequestModel
public record ControlWaitUntil
{
[Description("The time of day to wait (insert unscheduled time) until")]
public string When { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/WaitUntilExactRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ControlWaitUntilExact.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record WaitUntilExactRequestModel
public record ControlWaitUntilExact
{
[Description("The time to wait (insert unscheduled time) until")]
public DateTimeOffset When { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/WatermarkOffRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ControlWatermarkOff.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record WatermarkOffRequestModel
public record ControlWatermarkOff
{
[Description("A list of existing watermark names to turn off. All (scripted) watermarks will be turned off if this list is null or empty.")]
public List<string> Watermark { get; set; } = [];

2
ErsatzTV.Core/Api/ScriptedPlayout/WatermarkOnRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/ControlWatermarkOn.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record WatermarkOnRequestModel
public record ControlWatermarkOn
{
[Description("A list of existing watermark names to turn on")]
public List<string> Watermark { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/PeekItemResponseModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/PeekItemDuration.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public class PeekItemResponseModel
public class PeekItemDuration
{
public string Content { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/ContextResponseModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/PlayoutContext.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record ContextResponseModel
public record PlayoutContext
{
[Description("The current time of the playout build")]
public DateTimeOffset CurrentTime { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/AddCountRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/PlayoutCount.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record AddCountRequestModel
public record PlayoutCount
{
[Description("The 'key' for the content that should be added")]
public string Content { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/AddDurationRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/PlayoutDuration.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record AddDurationRequestModel
public record PlayoutDuration
{
[Description("The 'key' for the content that should be added")]
public string Content { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/PadToNextRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/PlayoutPadToNext.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record PadToNextRequestModel
public record PlayoutPadToNext
{
[Description("The 'key' for the content that should be added")]
public string Content { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/PadUntilRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/PlayoutPadUntil.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record PadUntilRequestModel
public record PlayoutPadUntil
{
[Description("The 'key' for the content that should be added")]
public string Content { get; set; }

2
ErsatzTV.Core/Api/ScriptedPlayout/PadUntilExactRequestModel.cs → ErsatzTV.Core/Api/ScriptedPlayout/PlayoutPadUntilExact.cs

@ -2,7 +2,7 @@ using System.ComponentModel; @@ -2,7 +2,7 @@ using System.ComponentModel;
namespace ErsatzTV.Core.Api.ScriptedPlayout;
public record PadUntilExactRequestModel
public record PlayoutPadUntilExact
{
[Description("The 'key' for the content that should be added")]
public string Content { get; set; }

68
ErsatzTV/Controllers/Api/ScriptedScheduleController.cs

@ -15,7 +15,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -15,7 +15,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpGet("context", Name = "GetContext")]
[Tags("Scripted Metadata")]
[EndpointSummary("Get the current context")]
public ActionResult<ContextResponseModel> GetContext([FromRoute] Guid buildId)
public ActionResult<PlayoutContext> GetContext([FromRoute] Guid buildId)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -33,7 +33,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -33,7 +33,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[FromRoute]
Guid buildId,
[FromBody]
AddCollectionRequestModel request,
ContentCollection request,
CancellationToken cancellationToken)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
@ -54,7 +54,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -54,7 +54,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("add_marathon", Name = "AddMarathon")]
[Tags("Scripted Content")]
[EndpointSummary("Add a marathon")]
public async Task<IActionResult> AddMarathon([FromRoute] Guid buildId, [FromBody] AddMarathonRequestModel request)
public async Task<IActionResult> AddMarathon([FromRoute] Guid buildId, [FromBody] ContentMarathon request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -85,7 +85,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -85,7 +85,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[FromRoute]
Guid buildId,
[FromBody]
AddMultiCollectionRequestModel request,
ContentMultiCollection request,
CancellationToken cancellationToken)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
@ -110,7 +110,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -110,7 +110,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[FromRoute]
Guid buildId,
[FromBody]
AddPlaylistRequestModel request,
ContentPlaylist request,
CancellationToken cancellationToken)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
@ -130,7 +130,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -130,7 +130,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[FromRoute]
Guid buildId,
[FromBody]
AddSearchQueryRequestModel request,
ContentSearch request,
CancellationToken cancellationToken)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
@ -155,7 +155,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -155,7 +155,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[FromRoute]
Guid buildId,
[FromBody]
AddSmartCollectionRequestModel request,
ContentSmartCollection request,
CancellationToken cancellationToken)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
@ -180,7 +180,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -180,7 +180,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[FromRoute]
Guid buildId,
[FromBody]
AddShowRequestModel request,
ContentShow request,
CancellationToken cancellationToken)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
@ -201,7 +201,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -201,7 +201,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("add_all", Name = "AddAll")]
[Tags("Scripted Scheduling")]
[EndpointSummary("Add all content")]
public ActionResult<ContextResponseModel> AddAll([FromRoute] Guid buildId, [FromBody] AddAllRequestModel request)
public ActionResult<PlayoutContext> AddAll([FromRoute] Guid buildId, [FromBody] ContentAll request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -222,11 +222,11 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -222,11 +222,11 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("add_count", Name = "AddCount")]
[Tags("Scripted Scheduling")]
[EndpointSummary("Add a specific number of content items")]
public ActionResult<ContextResponseModel> AddCount(
public ActionResult<PlayoutContext> AddCount(
[FromRoute]
Guid buildId,
[FromBody]
AddCountRequestModel request)
PlayoutCount request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -252,11 +252,11 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -252,11 +252,11 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("add_duration", Name = "AddDuration")]
[Tags("Scripted Scheduling")]
[EndpointSummary("Add content for a specific duration")]
public ActionResult<ContextResponseModel> AddDuration(
public ActionResult<PlayoutContext> AddDuration(
[FromRoute]
Guid buildId,
[FromBody]
AddDurationRequestModel request)
PlayoutDuration request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -287,9 +287,9 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -287,9 +287,9 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("pad_to_next", Name = "PadToNext")]
[Tags("Scripted Scheduling")]
[EndpointSummary("Add content until a specific minutes interval")]
public ActionResult<ContextResponseModel> PadToNext(
public ActionResult<PlayoutContext> PadToNext(
[FromRoute] Guid buildId,
[FromBody] PadToNextRequestModel request)
[FromBody] PlayoutPadToNext request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -320,9 +320,9 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -320,9 +320,9 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("pad_until", Name = "PadUntil")]
[Tags("Scripted Scheduling")]
[EndpointSummary("Add content until a specified time of day")]
public ActionResult<ContextResponseModel> PadUntil(
public ActionResult<PlayoutContext> PadUntil(
[FromRoute] Guid buildId,
[FromBody] PadUntilRequestModel request)
[FromBody] PlayoutPadUntil request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -354,11 +354,11 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -354,11 +354,11 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("pad_until_exact", Name = "PadUntilExact")]
[Tags("Scripted Scheduling")]
[EndpointSummary("Add content until an exact time")]
public ActionResult<ContextResponseModel> PadUntilExact(
public ActionResult<PlayoutContext> PadUntilExact(
[FromRoute]
Guid buildId,
[FromBody]
PadUntilExactRequestModel request)
PlayoutPadUntilExact request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -389,7 +389,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -389,7 +389,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpGet("peek_next/{content}", Name="PeekNext")]
[Tags("Scripted Scheduling")]
[EndpointSummary("Peek the next content item")]
public ActionResult<PeekItemResponseModel> PeekNext(Guid buildId, string content)
public ActionResult<PeekItemDuration> PeekNext(Guid buildId, string content)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -400,7 +400,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -400,7 +400,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
Option<MediaItem> maybeMediaItem = engine.PeekNext(content);
foreach (var mediaItem in maybeMediaItem)
{
return new PeekItemResponseModel
return new PeekItemDuration
{
Content = content,
Milliseconds = (long)engine.DurationForMediaItem(mediaItem).TotalMilliseconds
@ -413,7 +413,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -413,7 +413,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("start_epg_group", Name = "StartEpgGroup")]
[Tags("Scripted Control")]
[EndpointSummary("Start an EPG group")]
public IActionResult StartEpgGroup([FromRoute] Guid buildId, [FromBody] StartEpgGroupRequestModel request)
public IActionResult StartEpgGroup([FromRoute] Guid buildId, [FromBody] ControlStartEpgGroup request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -447,7 +447,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -447,7 +447,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[FromRoute]
Guid buildId,
[FromBody]
GraphicsOnRequestModel request,
ControlGraphicsOn request,
CancellationToken cancellationToken = default)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
@ -467,7 +467,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -467,7 +467,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[FromRoute]
Guid buildId,
[FromBody]
GraphicsOffRequestModel request,
ControlGraphicsOff request,
CancellationToken cancellationToken = default)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
@ -483,7 +483,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -483,7 +483,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("watermark_on", Name = "WatermarkOn")]
[Tags("Scripted Control")]
[EndpointSummary("Turn on watermarks")]
public async Task<IActionResult> WatermarkOn([FromRoute] Guid buildId, [FromBody] WatermarkOnRequestModel request)
public async Task<IActionResult> WatermarkOn([FromRoute] Guid buildId, [FromBody] ControlWatermarkOn request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -498,7 +498,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -498,7 +498,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("watermark_off", Name = "WatermarkOff")]
[Tags("Scripted Control")]
[EndpointSummary("Turn off watermarks")]
public async Task<IActionResult> WatermarkOff([FromRoute] Guid buildId, [FromBody] WatermarkOffRequestModel request)
public async Task<IActionResult> WatermarkOff([FromRoute] Guid buildId, [FromBody] ControlWatermarkOff request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -513,7 +513,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -513,7 +513,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("skip_items", Name = "SkipItems")]
[Tags("Scripted Control")]
[EndpointSummary("Skip a specific number of items")]
public IActionResult SkipItems([FromRoute] Guid buildId, [FromBody] SkipItemsRequestModel request)
public IActionResult SkipItems([FromRoute] Guid buildId, [FromBody] ControlSkipItems request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -528,7 +528,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -528,7 +528,7 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("skip_to_item", Name = "SkipToItem")]
[Tags("Scripted Control")]
[EndpointSummary("Skip to a specific episode")]
public IActionResult SkipToItem([FromRoute] Guid buildId, [FromBody] SkipToItemRequestModel request)
public IActionResult SkipToItem([FromRoute] Guid buildId, [FromBody] ControlSkipToItem request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -543,11 +543,11 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -543,11 +543,11 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("wait_until_exact", Name = "WaitUntilExact")]
[Tags("Scripted Control")]
[EndpointSummary("Wait until an exact time")]
public ActionResult<ContextResponseModel> WaitUntilExact(
public ActionResult<PlayoutContext> WaitUntilExact(
[FromRoute]
Guid buildId,
[FromBody]
WaitUntilExactRequestModel request)
ControlWaitUntilExact request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -563,11 +563,11 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -563,11 +563,11 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
[HttpPost("wait_until", Name = "WaitUntil")]
[Tags("Scripted Control")]
[EndpointSummary("Wait until the specified time of day")]
public ActionResult<ContextResponseModel> WaitUntilTime(
public ActionResult<PlayoutContext> WaitUntilTime(
[FromRoute]
Guid buildId,
[FromBody]
WaitUntilRequestModel request)
ControlWaitUntil request)
{
ISchedulingEngine engine = scriptedPlayoutBuilderService.GetEngine(buildId);
if (engine == null)
@ -583,12 +583,12 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP @@ -583,12 +583,12 @@ public class ScriptedScheduleController(IScriptedPlayoutBuilderService scriptedP
return GetContextInternal(engine);
}
private ActionResult<ContextResponseModel> GetContextInternal(ISchedulingEngine engine)
private ActionResult<PlayoutContext> GetContextInternal(ISchedulingEngine engine)
{
try
{
var state = engine.GetState();
var responseModel = new ContextResponseModel
var responseModel = new PlayoutContext
{
CurrentTime = state.CurrentTime,
StartTime = state.Start,

668
ErsatzTV/wwwroot/openapi/scripted-schedule-tagged.json

File diff suppressed because it is too large Load Diff

668
ErsatzTV/wwwroot/openapi/scripted-schedule.json

File diff suppressed because it is too large Load Diff

4
scripts/scripted-schedules/entrypoint.py

@ -7,7 +7,7 @@ import sys @@ -7,7 +7,7 @@ import sys
from uuid import UUID
import etv_client
from etv_client.api import scripted_schedule_api
from etv_client.api import ScriptedScheduleApi
def main():
parser = argparse.ArgumentParser(description="Run an ETV scripted schedule")
@ -32,7 +32,7 @@ def main(): @@ -32,7 +32,7 @@ def main():
reset_playout = getattr(script_module, 'reset_playout')
build_playout = getattr(script_module, 'build_playout')
api_instance = scripted_schedule_api.ScriptedScheduleApi(api_client)
api_instance = ScriptedScheduleApi(api_client)
context = api_instance.get_context(known_args.build_id)

Loading…
Cancel
Save