Bound bouquet lookup and preserve playback if OpenWebif is unavailable

This commit is contained in:
2026-10-23 18:34:23 +02:00
parent 4ff46f547b
commit 50b39fa40b
3 changed files with 42 additions and 5 deletions
+18 -2
View File
@@ -1145,9 +1145,25 @@ namespace Jellyfin.Plugin.Enigma2
_logger.LogInformation("[Enigma2] Start GetChannelStream");
var requestedReference = channelOid;
var currentChannels = await GetChannelsAsync(cancellationToken).ConfigureAwait(false);
IEnumerable<ChannelInfo> currentChannels = Array.Empty<ChannelInfo>();
using (var lookupDeadline = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken))
{
lookupDeadline.CancelAfter(TimeSpan.FromSeconds(5));
try
{
currentChannels = await GetChannelsAsync(lookupDeadline.Token).ConfigureAwait(false);
}
catch (Exception error) when (!cancellationToken.IsCancellationRequested
&& (error is OperationCanceledException || error is HttpRequestException
|| error is IOException || error is ApplicationException))
{
// A stale-reference repair must not prevent direct streaming
// when the receiver's web interface is temporarily unavailable.
_logger.LogWarning("[Enigma2] Current bouquet lookup unavailable ({FailureType}); retaining requested channel reference", error.GetType().Name);
}
}
cancellationToken.ThrowIfCancellationRequested();
channelOid = ChannelReferenceResolver.Resolve(channelOid, currentChannels, () =>
channelOid = !currentChannels.Any() ? channelOid : ChannelReferenceResolver.Resolve(channelOid, currentChannels, () =>
{
// Native playback has already checked the user's channel access.
// This internal lookup reads only Enigma2 channel metadata and