add fetch timeout

This commit is contained in:
Luke Pulverenti 2015-12-06 23:57:04 -05:00
parent 19076d0546
commit 9dfb7cc307
3 changed files with 9 additions and 23 deletions

View File

@ -105,11 +105,6 @@ namespace MediaBrowser.Server.Implementations.Library
return GetMediaStreamsForItem(list);
}
private int GetMaxAllowedBitrateForExternalSubtitleStream()
{
return 30000000;
}
private IEnumerable<MediaStream> GetMediaStreamsForItem(IEnumerable<MediaStream> streams)
{
var list = streams.ToList();
@ -120,25 +115,9 @@ namespace MediaBrowser.Server.Implementations.Library
if (subtitleStreams.Count > 0)
{
var videoStream = list.FirstOrDefault(i => i.Type == MediaStreamType.Video);
int maxAllowedBitrateForExternalSubtitleStream = GetMaxAllowedBitrateForExternalSubtitleStream();
var videoBitrate = videoStream == null ? maxAllowedBitrateForExternalSubtitleStream : videoStream.BitRate ?? maxAllowedBitrateForExternalSubtitleStream;
foreach (var subStream in subtitleStreams)
{
var supportsExternalStream = StreamSupportsExternalStream(subStream);
if (!subStream.IsExternal)
{
if (supportsExternalStream && videoBitrate >= maxAllowedBitrateForExternalSubtitleStream)
{
supportsExternalStream = false;
}
}
subStream.SupportsExternalStream = supportsExternalStream;
subStream.SupportsExternalStream = StreamSupportsExternalStream(subStream);
}
}

View File

@ -18,6 +18,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using CommonIO.Windows;
using ImageMagickSharp;
using MediaBrowser.Server.Implementations.Logging;
namespace MediaBrowser.ServerApplication
@ -47,6 +48,8 @@ namespace MediaBrowser.ServerApplication
var applicationPath = currentProcess.MainModule.FileName;
var architecturePath = Path.Combine(Path.GetDirectoryName(applicationPath), Environment.Is64BitProcess ? "x64" : "x86");
Wand.SetMagickCoderModulePath(architecturePath);
var success = SetDllDirectory(architecturePath);
var appPaths = CreateApplicationPaths(applicationPath, _isRunningAsService);

View File

@ -425,7 +425,11 @@ namespace MediaBrowser.WebDashboard.Api
builder.AppendFormat("window.appMode='{0}';", mode);
}
builder.AppendFormat("window.dashboardVersion='{0}';", version);
if (!string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
{
builder.AppendFormat("window.dashboardVersion='{0}';", version);
}
builder.Append("</script>");
var versionString = !string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase) ? "?v=" + version : string.Empty;