The Free Software Media System - Server Backend & API
display program data path and bookmark in the dashboard
Luke Pulverenti7736c8cefc30
diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.csindex 6c673d2065..ca18442a89 100644--- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs+++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs@@ -131,6 +131,16 @@ namespace MediaBrowser.Common.Implementations.HttpClientManagerawait options.ResourcePool.WaitAsync(options.CancellationToken).ConfigureAwait(false);}+ if ((DateTime.UtcNow - client.LastTimeout).TotalSeconds < 30)+ {+ if (options.ResourcePool != null)+ {+ options.ResourcePool.Release();+ }++ throw new HttpException(string.Format("Connection to {0} timed out", options.Url)) { IsTimedOut = true };+ }+_logger.Info("HttpClientManager.Get url: {0}", options.Url);trydiff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.csindex 7173425d15..37aa860472 100644--- a/MediaBrowser.Model/System/SystemInfo.cs+++ b/MediaBrowser.Model/System/SystemInfo.cs@@ -61,6 +61,12 @@ namespace MediaBrowser.Model.System/// <value>The id.</value>public string Id { get; set; }+ /// <summary>+ /// Gets or sets the program data path.+ /// </summary>+ /// <value>The program data path.</value>+ public string ProgramDataPath { get; set; }+/// <summary>/// Initializes a new instance of the <see cref="SystemInfo"/> class./// </summary>diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.csindex f4bf501e3b..91d79bda0e 100644--- a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs@@ -306,6 +306,33 @@ namespace MediaBrowser.Server.Implementations.HttpServerreturn;}+ var localPath = context.Request.Url.LocalPath;++ if (string.Equals(localPath, "/mediabrowser/", StringComparison.OrdinalIgnoreCase))+ {+ context.Response.Redirect(DefaultRedirectPath);+ context.Response.Close();+ return;+ }+ if (string.Equals(localPath, "/mediabrowser", StringComparison.OrdinalIgnoreCase))+ {+ context.Response.Redirect("mediabrowser/" + DefaultRedirectPath);+ context.Response.Close();+ return;+ }+ if (string.Equals(localPath, "/", StringComparison.OrdinalIgnoreCase))+ {+ context.Response.Redirect("mediabrowser/" + DefaultRedirectPath);+ context.Response.Close();+ return;+ }+ if (string.IsNullOrEmpty(localPath))+ {+ context.Response.Redirect("/mediabrowser/" + DefaultRedirectPath);+ context.Response.Close();+ return;+ }+RaiseReceiveWebRequest(context);await Task.Factory.StartNew(() =>diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.csindex eba92a57d7..17ee2d5979 100644--- a/MediaBrowser.ServerApplication/ApplicationHost.cs+++ b/MediaBrowser.ServerApplication/ApplicationHost.cs@@ -191,7 +191,7 @@ namespace MediaBrowser.ServerApplication{base.OnLoggerLoaded();- _httpServerCreationTask = Task.Run(() => ServerFactory.CreateServer(this, LogManager, "Media Browser", "index.html"));+ _httpServerCreationTask = Task.Run(() => ServerFactory.CreateServer(this, LogManager, "Media Browser", "dashboard/index.html"));}/// <summary>@@ -516,7 +516,8 @@ namespace MediaBrowser.ServerApplicationFailedPluginAssemblies = FailedAssemblies.ToArray(),InProgressInstallations = InstallationManager.CurrentInstallations.Select(i => i.Item1).ToArray(),CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(),- Id = _systemId+ Id = _systemId,+ ProgramDataPath = ApplicationPaths.ProgramDataPath};}