update plugin installs

This commit is contained in:
Luke Pulverenti
2015-11-10 08:36:15 -05:00
parent 81bb469fe1
commit 64a683e84d
4 changed files with 27 additions and 6 deletions

View File

@@ -82,7 +82,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
UserAgent = UserAgent,
CancellationToken = cancellationToken,
// The data can be large so give it some extra time
TimeoutMs = 120000,
TimeoutMs = 60000,
LogErrorResponseBody = true
};

View File

@@ -1208,6 +1208,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
var guideDays = GetGuideDays(list.Count);
_logger.Info("Refreshing guide with {0} days of guide data", guideDays);
cancellationToken.ThrowIfCancellationRequested();
foreach (var currentChannel in list)
@@ -1291,13 +1293,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv
}
}
private const int MaxGuideDays = 14;
private double GetGuideDays(int channelCount)
{
var config = GetConfiguration();
if (config.GuideDays.HasValue)
{
return config.GuideDays.Value;
return Math.Max(1, Math.Min(config.GuideDays.Value, MaxGuideDays));
}
var programsPerDay = channelCount * 48;
@@ -1306,7 +1309,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
var days = Math.Round(((double)maxPrograms) / programsPerDay);
return Math.Max(3, Math.Min(days, 14));
return Math.Max(3, Math.Min(days, MaxGuideDays));
}
private async Task<IEnumerable<Tuple<string, ChannelInfo>>> GetChannels(ILiveTvService service, CancellationToken cancellationToken)