fixed the plugin catalog not loading
This commit is contained in:
parent
ff6325efc5
commit
ca7ee68473
|
@ -1,5 +1,13 @@
|
|||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Common.Implementations.HttpServer;
|
||||
using MediaBrowser.Common.Implementations.Udp;
|
||||
using MediaBrowser.Common.Implementations.WebSocket;
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common.ScheduledTasks;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using SimpleInjector;
|
||||
using System;
|
||||
|
@ -130,6 +138,18 @@ namespace MediaBrowser.Common.Implementations
|
|||
/// </summary>
|
||||
/// <returns>IApplicationPaths.</returns>
|
||||
protected abstract IApplicationPaths GetApplicationPaths();
|
||||
|
||||
/// <summary>
|
||||
/// Finds the parts.
|
||||
/// </summary>
|
||||
protected virtual void FindParts()
|
||||
{
|
||||
Resolve<ITaskManager>().AddTasks(GetExports<IScheduledTask>(false));
|
||||
|
||||
Resolve<IHttpServer>().Init(GetExports<IRestfulService>(false));
|
||||
|
||||
Resolve<IServerManager>().AddWebSocketListeners(GetExports<IWebSocketListener>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Discovers the types.
|
||||
|
@ -143,6 +163,24 @@ namespace MediaBrowser.Common.Implementations
|
|||
AllConcreteTypes = AllTypes.Where(t => t.IsClass && !t.IsAbstract && !t.IsInterface && !t.IsGenericType).ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers resources that classes will depend on
|
||||
/// </summary>
|
||||
protected virtual void RegisterResources(ITaskManager taskManager, INetworkManager networkManager, IServerManager serverManager)
|
||||
{
|
||||
RegisterSingleInstance(LogManager);
|
||||
RegisterSingleInstance(Logger);
|
||||
|
||||
RegisterSingleInstance(ApplicationPaths);
|
||||
RegisterSingleInstance(taskManager);
|
||||
RegisterSingleInstance<IWebSocketServer>(() => new AlchemyServer(Logger));
|
||||
RegisterSingleInstance(ProtobufSerializer);
|
||||
RegisterSingleInstance<IUdpServer>(new UdpServer(Logger), false);
|
||||
|
||||
RegisterSingleInstance(networkManager);
|
||||
RegisterSingleInstance(serverManager);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of types within an assembly
|
||||
/// This will handle situations that would normally throw an exception - such as a type within the assembly that depends on some other non-existant reference
|
||||
|
|
|
@ -95,6 +95,12 @@ namespace MediaBrowser.Common.Implementations.ServerManager
|
|||
get { return SupportsNativeWebSocket ? _kernel.Configuration.HttpServerPortNumber : _kernel.Configuration.LegacyWebSocketPortNumber; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the web socket listeners.
|
||||
/// </summary>
|
||||
/// <value>The web socket listeners.</value>
|
||||
private List<IWebSocketListener> WebSocketListeners = new List<IWebSocketListener>();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ServerManager" /> class.
|
||||
/// </summary>
|
||||
|
@ -234,7 +240,7 @@ namespace MediaBrowser.Common.Implementations.ServerManager
|
|||
/// <param name="result">The result.</param>
|
||||
private async void ProcessWebSocketMessageReceived(WebSocketMessageInfo result)
|
||||
{
|
||||
var tasks = _kernel.WebSocketListeners.Select(i => Task.Run(async () =>
|
||||
var tasks = WebSocketListeners.Select(i => Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -514,5 +520,14 @@ namespace MediaBrowser.Common.Implementations.ServerManager
|
|||
ReloadExternalWebSocketServer();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the web socket listeners.
|
||||
/// </summary>
|
||||
/// <param name="listeners">The listeners.</param>
|
||||
public void AddWebSocketListeners(IEnumerable<IWebSocketListener> listeners)
|
||||
{
|
||||
WebSocketListeners.AddRange(listeners);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,11 +23,6 @@ namespace MediaBrowser.Common.Kernel
|
|||
where TConfigurationType : BaseApplicationConfiguration, new()
|
||||
where TApplicationPathsType : IApplicationPaths
|
||||
{
|
||||
/// <summary>
|
||||
/// Occurs when [has pending restart changed].
|
||||
/// </summary>
|
||||
public event EventHandler HasPendingRestartChanged;
|
||||
|
||||
#region ConfigurationUpdated Event
|
||||
/// <summary>
|
||||
/// Occurs when [configuration updated].
|
||||
|
@ -43,20 +38,6 @@ namespace MediaBrowser.Common.Kernel
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region ReloadBeginning Event
|
||||
/// <summary>
|
||||
/// Fires whenever the kernel begins reloading
|
||||
/// </summary>
|
||||
public event EventHandler<EventArgs> ReloadBeginning;
|
||||
/// <summary>
|
||||
/// Called when [reload beginning].
|
||||
/// </summary>
|
||||
private void OnReloadBeginning()
|
||||
{
|
||||
EventHelper.QueueEventIfNotNull(ReloadBeginning, this, EventArgs.Empty, Logger);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ReloadCompleted Event
|
||||
/// <summary>
|
||||
/// Fires whenever the kernel completes reloading
|
||||
|
@ -141,12 +122,6 @@ namespace MediaBrowser.Common.Kernel
|
|||
/// <value>The plugins.</value>
|
||||
public IEnumerable<IPlugin> Plugins { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the web socket listeners.
|
||||
/// </summary>
|
||||
/// <value>The web socket listeners.</value>
|
||||
public IEnumerable<IWebSocketListener> WebSocketListeners { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the TCP manager.
|
||||
/// </summary>
|
||||
|
@ -233,8 +208,6 @@ namespace MediaBrowser.Common.Kernel
|
|||
/// <returns>Task.</returns>
|
||||
public async Task Init()
|
||||
{
|
||||
OnReloadBeginning();
|
||||
|
||||
await ReloadInternal().ConfigureAwait(false);
|
||||
|
||||
OnReloadCompleted();
|
||||
|
@ -275,7 +248,6 @@ namespace MediaBrowser.Common.Kernel
|
|||
/// </summary>
|
||||
protected virtual void FindParts()
|
||||
{
|
||||
WebSocketListeners = ApplicationHost.GetExports<IWebSocketListener>();
|
||||
Plugins = ApplicationHost.GetExports<IPlugin>();
|
||||
}
|
||||
|
||||
|
@ -314,8 +286,6 @@ namespace MediaBrowser.Common.Kernel
|
|||
HasPendingRestart = true;
|
||||
|
||||
ServerManager.SendWebSocketMessage("HasPendingRestartChanged", GetSystemInfo());
|
||||
|
||||
EventHelper.QueueEventIfNotNull(HasPendingRestartChanged, this, EventArgs.Empty, Logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -96,12 +96,6 @@ namespace MediaBrowser.Common.Kernel
|
|||
/// <value>The plug-in security manager.</value>
|
||||
ISecurityManager SecurityManager { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the web socket listeners.
|
||||
/// </summary>
|
||||
/// <value>The web socket listeners.</value>
|
||||
IEnumerable<IWebSocketListener> WebSocketListeners { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [reload completed].
|
||||
/// </summary>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
@ -50,5 +51,11 @@ namespace MediaBrowser.Common.Kernel
|
|||
/// <returns>Task.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">messageType</exception>
|
||||
Task SendWebSocketMessageAsync<T>(string messageType, Func<T> dataFunction, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the web socket listeners.
|
||||
/// </summary>
|
||||
/// <param name="listeners">The listeners.</param>
|
||||
void AddWebSocketListeners(IEnumerable<IWebSocketListener> listeners);
|
||||
}
|
||||
}
|
|
@ -156,7 +156,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
|
|||
// Don't dispose in the middle of a flush
|
||||
while (IsFlushing)
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
Thread.Sleep(25);
|
||||
}
|
||||
|
||||
if (connection.IsOpen())
|
||||
|
|
|
@ -72,7 +72,6 @@ namespace MediaBrowser.ServerApplication
|
|||
public ApplicationHost()
|
||||
: base()
|
||||
{
|
||||
Logger.Info("ApplicationHost!!!!!!!!!!!!!!!!!!!!");
|
||||
Kernel = new Kernel(this, ServerApplicationPaths, _xmlSerializer, Logger);
|
||||
|
||||
var networkManager = new NetworkManager();
|
||||
|
@ -85,11 +84,9 @@ namespace MediaBrowser.ServerApplication
|
|||
|
||||
Logger.Info("Version {0} initializing", ApplicationVersion);
|
||||
|
||||
var httpServer = ServerFactory.CreateServer(this, ProtobufSerializer, Logger, "Media Browser", "index.html");
|
||||
RegisterResources(taskManager, networkManager, serverManager);
|
||||
|
||||
RegisterResources(taskManager, httpServer, networkManager, serverManager);
|
||||
|
||||
FindParts(taskManager, httpServer);
|
||||
FindParts();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -113,42 +110,23 @@ namespace MediaBrowser.ServerApplication
|
|||
/// <summary>
|
||||
/// Registers resources that classes will depend on
|
||||
/// </summary>
|
||||
private void RegisterResources(ITaskManager taskManager, IHttpServer httpServer, INetworkManager networkManager, IServerManager serverManager)
|
||||
protected override void RegisterResources(ITaskManager taskManager, INetworkManager networkManager, IServerManager serverManager)
|
||||
{
|
||||
base.RegisterResources(taskManager, networkManager, serverManager);
|
||||
|
||||
RegisterSingleInstance<IKernel>(Kernel);
|
||||
RegisterSingleInstance(Kernel);
|
||||
|
||||
RegisterSingleInstance<IApplicationHost>(this);
|
||||
RegisterSingleInstance(LogManager);
|
||||
RegisterSingleInstance(Logger);
|
||||
|
||||
RegisterSingleInstance(ApplicationPaths);
|
||||
RegisterSingleInstance(ServerApplicationPaths);
|
||||
RegisterSingleInstance(taskManager);
|
||||
RegisterSingleInstance<IIsoManager>(new PismoIsoManager(Logger));
|
||||
RegisterSingleInstance<IBlurayExaminer>(new BdInfoExaminer());
|
||||
RegisterSingleInstance<IHttpClient>(new HttpClientManager(ApplicationPaths, Logger));
|
||||
RegisterSingleInstance<IZipClient>(new DotNetZipClient());
|
||||
RegisterSingleInstance<IWebSocketServer>(() => new AlchemyServer(Logger));
|
||||
RegisterSingleInstance(_jsonSerializer);
|
||||
RegisterSingleInstance(_xmlSerializer);
|
||||
RegisterSingleInstance(ProtobufSerializer);
|
||||
RegisterSingleInstance<IUdpServer>(new UdpServer(Logger), false);
|
||||
RegisterSingleInstance(httpServer, false);
|
||||
|
||||
RegisterSingleInstance(networkManager);
|
||||
|
||||
RegisterSingleInstance(serverManager);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds the parts.
|
||||
/// </summary>
|
||||
private void FindParts(ITaskManager taskManager, IHttpServer httpServer)
|
||||
{
|
||||
taskManager.AddTasks(GetExports<IScheduledTask>(false));
|
||||
|
||||
httpServer.Init(GetExports<IRestfulService>(false));
|
||||
RegisterSingleInstance(ServerFactory.CreateServer(this, ProtobufSerializer, Logger, "Media Browser", "index.html"), false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -101,7 +101,6 @@ namespace MediaBrowser.ServerApplication
|
|||
|
||||
Kernel.Instance.ReloadCompleted += KernelReloadCompleted;
|
||||
_logManager.LoggerLoaded += LoadLogWindow;
|
||||
Kernel.Instance.HasPendingRestartChanged += Instance_HasPendingRestartChanged;
|
||||
Kernel.Instance.ConfigurationUpdated += Instance_ConfigurationUpdated;
|
||||
}
|
||||
|
||||
|
@ -131,19 +130,6 @@ namespace MediaBrowser.ServerApplication
|
|||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets visibility of the restart message when the kernel value changes
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
|
||||
void Instance_HasPendingRestartChanged(object sender, EventArgs e)
|
||||
{
|
||||
Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
MbTaskbarIcon.ToolTipText = Kernel.Instance.HasPendingRestart ? "Media Browser Server - Please restart to finish updating." : "Media Browser Server";
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the LibraryChanged event of the Instance control.
|
||||
/// </summary>
|
||||
|
|
|
@ -49,14 +49,14 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
/// <summary>
|
||||
/// Class GetDashboardResource
|
||||
/// </summary>
|
||||
[Route("/dashboard/{name*}", "GET")]
|
||||
[Route("/dashboard/{ResourceName*}", "GET")]
|
||||
public class GetDashboardResource
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name { get; set; }
|
||||
public string ResourceName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the V.
|
||||
/// </summary>
|
||||
|
@ -174,7 +174,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
/// <returns>System.Object.</returns>
|
||||
public object Get(GetDashboardResource request)
|
||||
{
|
||||
var path = request.Name;
|
||||
var path = request.ResourceName;
|
||||
|
||||
var contentType = MimeTypes.GetMimeType(path);
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.ApiClient</id>
|
||||
<version>3.0.0.9-beta</version>
|
||||
<version>3.0.0.10-beta</version>
|
||||
<title>MediaBrowser.ApiClient</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>scottisafool,Luke</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common.Internal</id>
|
||||
<version>3.0.9</version>
|
||||
<version>3.0.10</version>
|
||||
<title />
|
||||
<authors>Luke</authors>
|
||||
<owners>Media Browser Team</owners>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Contains common components shared by Media Browser Theatre and Media Browser Server. Not intended for plugin developer consumption.</description>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.9" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.10" />
|
||||
<dependency id="NLog" version="2.0.0.2000" />
|
||||
<dependency id="ServiceStack" version="3.9.37" />
|
||||
<dependency id="ServiceStack.Api.Swagger" version="3.9.35" />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common</id>
|
||||
<version>3.0.9</version>
|
||||
<version>3.0.10</version>
|
||||
<title>MediaBrowser.Common</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Server.Core</id>
|
||||
<version>3.0.9</version>
|
||||
<version>3.0.10</version>
|
||||
<title>Media Browser.Server.Core</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners />
|
||||
|
@ -10,7 +10,7 @@
|
|||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.9" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.10" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
|
Loading…
Reference in New Issue
Block a user