Bound bouquet lookup and preserve playback if OpenWebif is unavailable
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user