aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-06-01 23:17:10 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-06-01 23:17:10 -0400
commit7736c8cefc3093d1edcd056f5e89fdb1cdca926f (patch)
tree85b64b9c0caef664e8236a8637f32089e5686879
parent5b280de5196a382b3651c7073cf5e76ae7e6e761 (diff)
display program data path and bookmark in the dashboard
-rw-r--r--MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs10
-rw-r--r--MediaBrowser.Model/System/SystemInfo.cs6
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs27
-rw-r--r--MediaBrowser.ServerApplication/ApplicationHost.cs5
4 files changed, 46 insertions, 2 deletions
diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
index 6c673d206..ca18442a8 100644
--- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
@@ -131,6 +131,16 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
await 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);
try
diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs
index 7173425d1..37aa86047 100644
--- a/MediaBrowser.Model/System/SystemInfo.cs
+++ b/MediaBrowser.Model/System/SystemInfo.cs
@@ -62,6 +62,12 @@ namespace MediaBrowser.Model.System
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>
public SystemInfo()
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
index f4bf501e3..91d79bda0 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
@@ -306,6 +306,33 @@ namespace MediaBrowser.Server.Implementations.HttpServer
return;
}
+ 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.cs
index eba92a57d..17ee2d597 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.ServerApplication
FailedPluginAssemblies = FailedAssemblies.ToArray(),
InProgressInstallations = InstallationManager.CurrentInstallations.Select(i => i.Item1).ToArray(),
CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(),
- Id = _systemId
+ Id = _systemId,
+ ProgramDataPath = ApplicationPaths.ProgramDataPath
};
}