From de1495763f6c54906e8f06f147bfa76a9d1c6bec Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 28 Dec 2015 13:41:53 -0500 Subject: [PATCH] add tuner error handling --- .../LiveTv/TunerHosts/BaseTunerHost.cs | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs index 41ba1967a6..4ebc173b54 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs @@ -107,11 +107,18 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts foreach (var host in hosts) { - var channels = await GetChannels(host, true, cancellationToken).ConfigureAwait(false); - - if (channels.Any(i => string.Equals(i.Id, channelId, StringComparison.OrdinalIgnoreCase))) + try { - hostsWithChannel.Add(host); + var channels = await GetChannels(host, true, cancellationToken).ConfigureAwait(false); + + if (channels.Any(i => string.Equals(i.Id, channelId, StringComparison.OrdinalIgnoreCase))) + { + hostsWithChannel.Add(host); + } + } + catch (Exception ex) + { + Logger.Error("Error getting channels", ex); } } @@ -172,11 +179,18 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts { if (string.IsNullOrWhiteSpace(streamId)) { - var channels = await GetChannels(host, true, cancellationToken).ConfigureAwait(false); - - if (channels.Any(i => string.Equals(i.Id, channelId, StringComparison.OrdinalIgnoreCase))) + try { - hostsWithChannel.Add(host); + var channels = await GetChannels(host, true, cancellationToken).ConfigureAwait(false); + + if (channels.Any(i => string.Equals(i.Id, channelId, StringComparison.OrdinalIgnoreCase))) + { + hostsWithChannel.Add(host); + } + } + catch (Exception ex) + { + Logger.Error("Error getting channels", ex); } } else if (streamId.StartsWith(host.Id, StringComparison.OrdinalIgnoreCase))