remove copyts from hls

This commit is contained in:
Luke Pulverenti
2015-04-03 11:50:50 -04:00
parent 439e7efecb
commit 4655a60d29
3 changed files with 25 additions and 21 deletions

View File

@@ -169,29 +169,32 @@ namespace MediaBrowser.Server.Implementations.Channels
foreach (var item in result.Items)
{
var channelItem = (IChannelMediaItem)item;
var channelItem = item as IChannelMediaItem;
var channelFeatures = _manager.GetChannelFeatures(channelItem.ChannelId);
if (channelFeatures.SupportsContentDownloading)
if (channelItem != null)
{
if (options.DownloadingChannels.Contains(channelItem.ChannelId))
var channelFeatures = _manager.GetChannelFeatures(channelItem.ChannelId);
if (channelFeatures.SupportsContentDownloading)
{
try
if (options.DownloadingChannels.Contains(channelItem.ChannelId))
{
await DownloadChannelItem(channelItem, options, cancellationToken, path);
}
catch (OperationCanceledException)
{
break;
}
catch (ChannelDownloadException)
{
// Logged at lower levels
}
catch (Exception ex)
{
_logger.ErrorException("Error downloading channel content for {0}", ex, item.Name);
try
{
await DownloadChannelItem(channelItem, options, cancellationToken, path);
}
catch (OperationCanceledException)
{
break;
}
catch (ChannelDownloadException)
{
// Logged at lower levels
}
catch (Exception ex)
{
_logger.ErrorException("Error downloading channel content for {0}", ex, item.Name);
}
}
}
}