From 2989faeb089e504ecf75652735ae41abe8406fcf Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Mon, 7 Sep 2026 11:56:35 -0500 Subject: [PATCH] fix: sessions api with next engine (#3009) * fix: sessions api with next engine * regen openapi --- CHANGELOG.md | 1 + ErsatzTV.Application/Streaming/NextSessionWorker.cs | 12 +++++++++--- ErsatzTV.Core/FFmpeg/HlsSessionModel.cs | 2 +- .../wwwroot/openapi/scripted-schedule-tagged.json | 2 +- ErsatzTV/wwwroot/openapi/scripted-schedule.json | 2 +- ErsatzTV/wwwroot/openapi/v1.json | 5 ++++- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c965f1f0..37467a469 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Fix health checks causing a flood of (harmless) logged errors when quickly navigating away from home page - Health check results will now be cached for 5 minutes by default; a refresh button has been added to immediately re-run all checks +- Fix `/api/sessions` response when channels use Next streaming engine ## [26.9.0] - 2026-09-06 ### Fixed diff --git a/ErsatzTV.Application/Streaming/NextSessionWorker.cs b/ErsatzTV.Application/Streaming/NextSessionWorker.cs index 4c923f68b..80c862ca3 100644 --- a/ErsatzTV.Application/Streaming/NextSessionWorker.cs +++ b/ErsatzTV.Application/Streaming/NextSessionWorker.cs @@ -87,15 +87,21 @@ public class NextSessionWorker( public Task> TrimPlaylist( DateTimeOffset filterBefore, - CancellationToken cancellationToken) => - throw new NotSupportedException(); + CancellationToken cancellationToken) + { + logger.LogWarning( + "Legacy path called for next session worker on channel {Number}; this is NOT supported", + _channelNumber); + + return Task.FromResult(Option.None); + } public void PlayoutUpdated() { // nothing to do here; channel binary should detect that by itself } - public HlsSessionModel GetModel() => throw new NotSupportedException(); + public HlsSessionModel GetModel() => new(_channelNumber, "next", null, _lastTouch); public async Task Run( string channelNumber, diff --git a/ErsatzTV.Core/FFmpeg/HlsSessionModel.cs b/ErsatzTV.Core/FFmpeg/HlsSessionModel.cs index 081fc00a2..407eb55b2 100644 --- a/ErsatzTV.Core/FFmpeg/HlsSessionModel.cs +++ b/ErsatzTV.Core/FFmpeg/HlsSessionModel.cs @@ -3,5 +3,5 @@ namespace ErsatzTV.Core.FFmpeg; public record HlsSessionModel( string ChannelNumber, string State, - DateTimeOffset TranscodedUntil, + DateTimeOffset? TranscodedUntil, DateTimeOffset LastAccess); diff --git a/ErsatzTV/wwwroot/openapi/scripted-schedule-tagged.json b/ErsatzTV/wwwroot/openapi/scripted-schedule-tagged.json index c7cfff812..da39a64bb 100644 --- a/ErsatzTV/wwwroot/openapi/scripted-schedule-tagged.json +++ b/ErsatzTV/wwwroot/openapi/scripted-schedule-tagged.json @@ -1569,7 +1569,7 @@ }, "groupBy": { "type": "string", - "description": "Tells the scheduler how to group the combined content (returned from all guids and searches). Valid values are show, season, artist and album." + "description": "Tells the scheduler how to group the combined content (returned from all guids and searches). Valid values are show, season, artist, album and director." }, "itemOrder": { "type": "string", diff --git a/ErsatzTV/wwwroot/openapi/scripted-schedule.json b/ErsatzTV/wwwroot/openapi/scripted-schedule.json index c5f2e3f8b..da226a305 100644 --- a/ErsatzTV/wwwroot/openapi/scripted-schedule.json +++ b/ErsatzTV/wwwroot/openapi/scripted-schedule.json @@ -1569,7 +1569,7 @@ }, "groupBy": { "type": "string", - "description": "Tells the scheduler how to group the combined content (returned from all guids and searches). Valid values are show, season, artist and album." + "description": "Tells the scheduler how to group the combined content (returned from all guids and searches). Valid values are show, season, artist, album and director." }, "itemOrder": { "type": "string", diff --git a/ErsatzTV/wwwroot/openapi/v1.json b/ErsatzTV/wwwroot/openapi/v1.json index 93da2ddd4..138fd833a 100644 --- a/ErsatzTV/wwwroot/openapi/v1.json +++ b/ErsatzTV/wwwroot/openapi/v1.json @@ -1074,7 +1074,10 @@ ] }, "transcodedUntil": { - "type": "string", + "type": [ + "null", + "string" + ], "format": "date-time" }, "lastAccess": {