update translations

This commit is contained in:
Luke Pulverenti
2014-08-14 09:24:30 -04:00
parent 02e25b4855
commit 9c5cceb4ec
124 changed files with 1569 additions and 534 deletions

View File

@@ -7,6 +7,7 @@ using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Channels;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.MediaInfo;
@@ -154,7 +155,7 @@ namespace MediaBrowser.Server.Implementations.Channels
{
try
{
await DownloadChannelItem(item, cancellationToken, path);
await DownloadChannelItem(item, options, cancellationToken, path);
}
catch (OperationCanceledException)
{
@@ -176,9 +177,18 @@ namespace MediaBrowser.Server.Implementations.Channels
}
private async Task DownloadChannelItem(BaseItemDto item,
ChannelOptions channelOptions,
CancellationToken cancellationToken,
string path)
{
if (channelOptions.DownloadSizeLimit.HasValue)
{
if (IsSizeLimitReached(path, channelOptions.DownloadSizeLimit.Value))
{
return;
}
}
var sources = await _manager.GetChannelItemMediaSources(item.Id, cancellationToken)
.ConfigureAwait(false);
@@ -253,6 +263,25 @@ namespace MediaBrowser.Server.Implementations.Channels
}
}
private bool IsSizeLimitReached(string path, double gbLimit)
{
var byteLimit = gbLimit*1000000000;
long total = 0;
foreach (var file in new DirectoryInfo(path).EnumerateFiles("*", SearchOption.AllDirectories))
{
total += file.Length;
if (total >= byteLimit)
{
return true;
}
}
return false;
}
private async Task RefreshMediaSourceItems(IEnumerable<MediaSourceInfo> items, CancellationToken cancellationToken)
{
foreach (var item in items)