mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-09 07:10:34 +02:00
fix web socket message name for library change
This commit is contained in:
parent
6e58ae31bd
commit
bd5bf32aba
|
@ -202,5 +202,13 @@ namespace MediaBrowser.Common.Implementations.Logging
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Flushes this instance.
|
||||||
|
/// </summary>
|
||||||
|
public void Flush()
|
||||||
|
{
|
||||||
|
LogManager.Flush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,5 +35,10 @@ namespace MediaBrowser.Model.Logging
|
||||||
/// Occurs when [logger loaded].
|
/// Occurs when [logger loaded].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
event EventHandler LoggerLoaded;
|
event EventHandler LoggerLoaded;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Flushes this instance.
|
||||||
|
/// </summary>
|
||||||
|
void Flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||||
|
|
||||||
return socket.SendAsync(new WebSocketMessage<LibraryUpdateInfo>
|
return socket.SendAsync(new WebSocketMessage<LibraryUpdateInfo>
|
||||||
{
|
{
|
||||||
MessageType = "Playstate",
|
MessageType = "LibraryChanged",
|
||||||
Data = info
|
Data = info
|
||||||
|
|
||||||
}, cancellationToken);
|
}, cancellationToken);
|
||||||
|
|
|
@ -4,7 +4,6 @@ using MediaBrowser.Common.Net;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.WebSocket
|
namespace MediaBrowser.Server.Implementations.WebSocket
|
||||||
{
|
{
|
||||||
|
@ -29,6 +28,8 @@ namespace MediaBrowser.Server.Implementations.WebSocket
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
|
|
||||||
|
private bool _hasStopped;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="AlchemyServer" /> class.
|
/// Initializes a new instance of the <see cref="AlchemyServer" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -57,6 +58,8 @@ namespace MediaBrowser.Server.Implementations.WebSocket
|
||||||
/// <param name="portNumber">The port number.</param>
|
/// <param name="portNumber">The port number.</param>
|
||||||
public void Start(int portNumber)
|
public void Start(int portNumber)
|
||||||
{
|
{
|
||||||
|
_logger.Info("Starting Alchemy web socket server on port {0}", portNumber);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
WebSocketServer = new WebSocketServer(portNumber, IPAddress.Any)
|
WebSocketServer = new WebSocketServer(portNumber, IPAddress.Any)
|
||||||
|
@ -87,6 +90,11 @@ namespace MediaBrowser.Server.Implementations.WebSocket
|
||||||
/// <param name="context">The context.</param>
|
/// <param name="context">The context.</param>
|
||||||
private void OnAlchemyWebSocketClientConnected(UserContext context)
|
private void OnAlchemyWebSocketClientConnected(UserContext context)
|
||||||
{
|
{
|
||||||
|
if (_hasStopped)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (WebSocketConnected != null)
|
if (WebSocketConnected != null)
|
||||||
{
|
{
|
||||||
var socket = new AlchemyWebSocket(context, _logger);
|
var socket = new AlchemyWebSocket(context, _logger);
|
||||||
|
@ -127,6 +135,8 @@ namespace MediaBrowser.Server.Implementations.WebSocket
|
||||||
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||||
protected virtual void Dispose(bool dispose)
|
protected virtual void Dispose(bool dispose)
|
||||||
{
|
{
|
||||||
|
_hasStopped = true;
|
||||||
|
|
||||||
lock (_syncLock)
|
lock (_syncLock)
|
||||||
{
|
{
|
||||||
if (WebSocketServer != null)
|
if (WebSocketServer != null)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Runtime.InteropServices;
|
using MediaBrowser.Common.Constants;
|
||||||
using MediaBrowser.Common.Constants;
|
|
||||||
using MediaBrowser.Common.Implementations.Logging;
|
using MediaBrowser.Common.Implementations.Logging;
|
||||||
using MediaBrowser.Common.Implementations.Updates;
|
using MediaBrowser.Common.Implementations.Updates;
|
||||||
using MediaBrowser.Controller.IO;
|
using MediaBrowser.Controller.IO;
|
||||||
|
@ -13,6 +12,7 @@ using System.Configuration.Install;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.ServiceProcess;
|
using System.ServiceProcess;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
|
@ -251,9 +251,7 @@ namespace MediaBrowser.ServerApplication
|
||||||
|
|
||||||
if (_isRestarting)
|
if (_isRestarting)
|
||||||
{
|
{
|
||||||
using (var process = Process.Start("cmd", "/c net start " + BackgroundService.Name))
|
Process.Start("cmd", "/c net start " + BackgroundService.Name);
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
_logger.Info("New service process started");
|
_logger.Info("New service process started");
|
||||||
}
|
}
|
||||||
|
@ -383,6 +381,8 @@ namespace MediaBrowser.ServerApplication
|
||||||
|
|
||||||
_logger.ErrorException("UnhandledException", exception);
|
_logger.ErrorException("UnhandledException", exception);
|
||||||
|
|
||||||
|
_appHost.LogManager.Flush();
|
||||||
|
|
||||||
if (!_isRunningAsService)
|
if (!_isRunningAsService)
|
||||||
{
|
{
|
||||||
_app.OnUnhandledException(exception);
|
_app.OnUnhandledException(exception);
|
||||||
|
@ -390,7 +390,7 @@ namespace MediaBrowser.ServerApplication
|
||||||
|
|
||||||
if (!Debugger.IsAttached)
|
if (!Debugger.IsAttached)
|
||||||
{
|
{
|
||||||
Environment.Exit(System.Runtime.InteropServices.Marshal.GetHRForException(exception));
|
Environment.Exit(Marshal.GetHRForException(exception));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,13 +411,16 @@ namespace MediaBrowser.ServerApplication
|
||||||
// Update is there - execute update
|
// Update is there - execute update
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
new ApplicationUpdater().UpdateApplication(MBApplication.MBServer, appPaths, updateArchive);
|
var serviceName = _isRunningAsService ? BackgroundService.Name : string.Empty;
|
||||||
|
new ApplicationUpdater().UpdateApplication(MBApplication.MBServer, appPaths, updateArchive, logger, serviceName);
|
||||||
|
|
||||||
// And just let the app exit so it can update
|
// And just let the app exit so it can update
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
logger.ErrorException("Error starting updater.", e);
|
||||||
|
|
||||||
MessageBox.Show(string.Format("Error attempting to update application.\n\n{0}\n\n{1}", e.GetType().Name, e.Message));
|
MessageBox.Show(string.Format("Error attempting to update application.\n\n{0}\n\n{1}", e.GetType().Name, e.Message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue