mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-28 04:55:11 +01:00
added a shutdown api method, font size fix and other decouplings
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user