From d2cae4012853bb6457554516f06e5bbf11121b8d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 18 Jan 2014 23:25:01 -0500 Subject: rework news downloading --- .../LiveTv/LiveTvManager.cs | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Server.Implementations/LiveTv') diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 8577e7510e..f62efd9da6 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -229,6 +229,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv return result; } + catch (Exception ex) + { + _logger.ErrorException("Error getting recording stream", ex); + + throw; + } finally { _liveStreamSemaphore.Release(); @@ -245,6 +251,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv var channel = GetInternalChannel(id); + _logger.Info("Opening channel stream from {0}, external channel Id: {1}", service.Name, channel.ChannelInfo.Id); + var result = await service.GetChannelStream(channel.ChannelInfo.Id, cancellationToken).ConfigureAwait(false); if (!string.IsNullOrEmpty(result.Id)) @@ -254,6 +262,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv return result; } + catch (Exception ex) + { + _logger.ErrorException("Error getting channel stream", ex); + + throw; + } finally { _liveStreamSemaphore.Release(); @@ -1261,9 +1275,19 @@ namespace MediaBrowser.Server.Implementations.LiveTv { await _liveStreamSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false); + var service = ActiveService; + + _logger.Info("Closing live stream from {0}, stream Id: {1}", service.Name, id); + try { - await ActiveService.CloseLiveStream(id, cancellationToken).ConfigureAwait(false); + await service.CloseLiveStream(id, cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + _logger.ErrorException("Error closing live stream", ex); + + throw; } finally { -- cgit v1.2.3