added a shutdown api method, font size fix and other decouplings

This commit is contained in:
LukePulverenti
2013-02-26 11:10:55 -05:00
parent efdb2f3990
commit 6efd22a3d2
30 changed files with 420 additions and 235 deletions

View File

@@ -1,6 +1,5 @@
using MediaBrowser.Common.IO;
using MediaBrowser.Common.Kernel;
using MediaBrowser.Controller;
using MediaBrowser.Model.Logging;
using System;
using System.Collections.Generic;
@@ -27,18 +26,20 @@ namespace MediaBrowser.Api.WebSocket
/// <summary>
/// The _kernel
/// </summary>
private readonly IApplicationHost _appHost;
private readonly IKernel _kernel;
/// <summary>
/// Initializes a new instance of the <see cref="LogFileWebSocketListener" /> class.
/// </summary>
/// <param name="logger">The logger.</param>
/// <param name="kernel">The kernel.</param>
public LogFileWebSocketListener(ILogger logger, Kernel kernel)
public LogFileWebSocketListener(ILogger logger, IApplicationHost host, IKernel kernel)
: base(logger)
{
_appHost = host;
_kernel = kernel;
_kernel.LoggerLoaded += kernel_LoggerLoaded;
kernel.LoggerLoaded += kernel_LoggerLoaded;
}
/// <summary>
@@ -48,9 +49,9 @@ namespace MediaBrowser.Api.WebSocket
/// <returns>IEnumerable{System.String}.</returns>
protected override async Task<IEnumerable<string>> GetDataToSend(LogFileWebSocketState state)
{
if (!string.Equals(_kernel.LogFilePath, state.LastLogFilePath))
if (!string.Equals(_appHost.LogFilePath, state.LastLogFilePath))
{
state.LastLogFilePath = _kernel.LogFilePath;
state.LastLogFilePath = _appHost.LogFilePath;
state.StartLine = 0;
}