diff options
| -rw-r--r-- | MediaBrowser.Controller/Kernel.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.ServerApplication/WebSocketEvents.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.WebDashboard/Api/DashboardService.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj | 1 | ||||
| -rw-r--r-- | MediaBrowser.WebDashboard/ServerEntryPoint.cs | 34 |
5 files changed, 38 insertions, 10 deletions
diff --git a/MediaBrowser.Controller/Kernel.cs b/MediaBrowser.Controller/Kernel.cs index 947fb8e6d..2cf6fd188 100644 --- a/MediaBrowser.Controller/Kernel.cs +++ b/MediaBrowser.Controller/Kernel.cs @@ -75,12 +75,6 @@ namespace MediaBrowser.Controller public IEnumerable<LocalizedStringData> StringFiles { get; private set; } /// <summary> - /// Gets the list of plugin configuration pages - /// </summary> - /// <value>The configuration pages.</value> - public IEnumerable<IPluginConfigurationPage> PluginConfigurationPages { get; private set; } - - /// <summary> /// Gets the list of currently registered weather prvoiders /// </summary> /// <value>The weather providers.</value> @@ -204,7 +198,6 @@ namespace MediaBrowser.Controller DisplayPreferencesRepositories = ApplicationHost.GetExports<IDisplayPreferencesRepository>(); ItemRepositories = ApplicationHost.GetExports<IItemRepository>(); WeatherProviders = ApplicationHost.GetExports<IWeatherProvider>(); - PluginConfigurationPages = ApplicationHost.GetExports<IPluginConfigurationPage>(); ImageEnhancers = ApplicationHost.GetExports<IImageEnhancer>().OrderBy(e => e.Priority).ToArray(); StringFiles = ApplicationHost.GetExports<LocalizedStringData>(); MetadataProviders = ApplicationHost.GetExports<BaseMetadataProvider>().OrderBy(e => e.Priority).ToArray(); diff --git a/MediaBrowser.ServerApplication/WebSocketEvents.cs b/MediaBrowser.ServerApplication/WebSocketEvents.cs index 4d6720869..caa4ca2ab 100644 --- a/MediaBrowser.ServerApplication/WebSocketEvents.cs +++ b/MediaBrowser.ServerApplication/WebSocketEvents.cs @@ -14,7 +14,7 @@ namespace MediaBrowser.ServerApplication /// <summary> /// Class WebSocketEvents /// </summary> - public class WebSocketEvents : IServerEntryPoint, IDisposable + public class WebSocketEvents : IServerEntryPoint { /// <summary> /// The _server manager diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 1603fc9eb..4cc34ba28 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 4d1685d02..6e51ad0d2 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 000000000..690c07d8f --- /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() + { + } + } +} |
