aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-04-03 11:50:50 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-04-03 11:50:50 -0400
commit4655a60d2992b2bb674dda783fbaeb5fba48918f (patch)
treeb4fdc008ac3bc721552b112030c45a9e0eb7dd23 /MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
parent439e7efecb7f3612493dea864ccfb46c180ae528 (diff)
remove copyts from hls
Diffstat (limited to 'MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs41
1 files changed, 22 insertions, 19 deletions
diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs b/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
index 980c3f31b..651489347 100644
--- a/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
+++ b/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
@@ -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
- {
- await DownloadChannelItem(channelItem, options, cancellationToken, path);
- }
- catch (OperationCanceledException)
- {
- break;
- }
- catch (ChannelDownloadException)
- {
- // Logged at lower levels
- }
- catch (Exception ex)
+ if (options.DownloadingChannels.Contains(channelItem.ChannelId))
{
- _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);
+ }
}
}
}