From e87b54f0805ea636bae47d52599edaaae880ef60 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Mon, 7 Sep 2026 11:47:03 -0500 Subject: [PATCH] fix: sessions api with next engine --- CHANGELOG.md | 1 + ErsatzTV.Application/Streaming/NextSessionWorker.cs | 12 +++++++++--- ErsatzTV.Core/FFmpeg/HlsSessionModel.cs | 2 +- 3 files changed, 11 insertions(+), 4 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);