aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.WebDashboard
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-03-04 23:34:00 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-03-04 23:34:00 -0500
commit176d09016497524c83f0ff9f0cc99a5ae433dad5 (patch)
tree365787bc9d8532c6996de8b58c66fc414d014e68 /MediaBrowser.WebDashboard
parentbf95cfe2e50517df46e6f849aba58b6fed2141c7 (diff)
removed plugin configuration pages from the kernel
Diffstat (limited to 'MediaBrowser.WebDashboard')
-rw-r--r--MediaBrowser.WebDashboard/Api/DashboardService.cs4
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj1
-rw-r--r--MediaBrowser.WebDashboard/ServerEntryPoint.cs34
3 files changed, 37 insertions, 2 deletions
diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs
index 1603fc9eb1..4cc34ba28b 100644
--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs
+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs
@@ -147,7 +147,7 @@ namespace MediaBrowser.WebDashboard.Api
/// <returns>System.Object.</returns>
public object Get(GetDashboardConfigurationPage request)
{
- var page = Kernel.Instance.PluginConfigurationPages.First(p => p.Name.Equals(request.Name, StringComparison.OrdinalIgnoreCase));
+ var page = ServerEntryPoint.Instance.PluginConfigurationPages.First(p => p.Name.Equals(request.Name, StringComparison.OrdinalIgnoreCase));
return ToStaticResult(page.Version.GetMD5(), page.DateLastModified, null, MimeTypes.GetMimeType("page.html"), () => ModifyHtml(page.GetHtmlStream()));
}
@@ -159,7 +159,7 @@ namespace MediaBrowser.WebDashboard.Api
/// <returns>System.Object.</returns>
public object Get(GetDashboardConfigurationPages request)
{
- var pages = Kernel.Instance.PluginConfigurationPages;
+ var pages = ServerEntryPoint.Instance.PluginConfigurationPages;
if (request.PageType.HasValue)
{
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index 4d1685d026..6e51ad0d2f 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -85,6 +85,7 @@
<Compile Include="Api\DashboardService.cs" />
<Compile Include="Api\DashboardInfoWebSocketListener.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="ServerEntryPoint.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.Common.Implementations\MediaBrowser.Common.Implementations.csproj">
diff --git a/MediaBrowser.WebDashboard/ServerEntryPoint.cs b/MediaBrowser.WebDashboard/ServerEntryPoint.cs
new file mode 100644
index 0000000000..690c07d8ff
--- /dev/null
+++ b/MediaBrowser.WebDashboard/ServerEntryPoint.cs
@@ -0,0 +1,34 @@
+using MediaBrowser.Common;
+using MediaBrowser.Controller.Plugins;
+using System.Collections.Generic;
+
+namespace MediaBrowser.WebDashboard
+{
+ public class ServerEntryPoint : IServerEntryPoint
+ {
+ /// <summary>
+ /// Gets the list of plugin configuration pages
+ /// </summary>
+ /// <value>The configuration pages.</value>
+ public IEnumerable<IPluginConfigurationPage> PluginConfigurationPages { get; private set; }
+
+ private readonly IApplicationHost _appHost;
+
+ public static ServerEntryPoint Instance { get; private set; }
+
+ public ServerEntryPoint(IApplicationHost appHost)
+ {
+ _appHost = appHost;
+ Instance = this;
+ }
+
+ public void Run()
+ {
+ PluginConfigurationPages = _appHost.GetExports<IPluginConfigurationPage>();
+ }
+
+ public void Dispose()
+ {
+ }
+ }
+}