add more sync buttons

This commit is contained in:
Luke Pulverenti
2014-12-18 23:20:07 -05:00
parent e3484bdcc2
commit e55ab989d2
46 changed files with 380 additions and 872 deletions

View File

@@ -72,26 +72,29 @@ namespace MediaBrowser.Server.Implementations.Channels
var features = _channelManager.GetChannelFeatures(channelId);
const int currentRefreshLevel = 1;
var maxRefreshLevel = features.AutoRefreshLevels ?? 1;
var maxRefreshLevel = features.AutoRefreshLevels ?? 0;
var innerProgress = new ActionableProgress<double>();
if (maxRefreshLevel > 0)
{
var innerProgress = new ActionableProgress<double>();
var startingNumberComplete = numComplete;
innerProgress.RegisterAction(p =>
{
double innerPercent = startingNumberComplete;
innerPercent += (p / 100);
innerPercent /= numItems;
progress.Report(innerPercent * 100);
});
var startingNumberComplete = numComplete;
innerProgress.RegisterAction(p =>
{
double innerPercent = startingNumberComplete;
innerPercent += (p / 100);
innerPercent /= numItems;
progress.Report(innerPercent * 100);
});
try
{
await GetAllItems(user, channelId, null, currentRefreshLevel, maxRefreshLevel, innerProgress, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
{
_logger.ErrorException("Error getting channel content", ex);
try
{
await GetAllItems(user, channelId, null, currentRefreshLevel, maxRefreshLevel, innerProgress, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
{
_logger.ErrorException("Error getting channel content", ex);
}
}
numComplete++;