mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-08 23:00:51 +02:00
update standby
This commit is contained in:
parent
87091b6196
commit
c7e99f424e
|
@ -273,11 +273,13 @@ namespace MediaBrowser.ServerApplication
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ServerNotifyIcon _serverNotifyIcon;
|
private static ServerNotifyIcon _serverNotifyIcon;
|
||||||
|
private static TaskScheduler _mainTaskScheduler;
|
||||||
private static void ShowTrayIcon()
|
private static void ShowTrayIcon()
|
||||||
{
|
{
|
||||||
//Application.EnableVisualStyles();
|
//Application.EnableVisualStyles();
|
||||||
//Application.SetCompatibleTextRenderingDefault(false);
|
//Application.SetCompatibleTextRenderingDefault(false);
|
||||||
_serverNotifyIcon = new ServerNotifyIcon(_appHost.LogManager, _appHost, _appHost.ServerConfigurationManager, _appHost.LocalizationManager);
|
_serverNotifyIcon = new ServerNotifyIcon(_appHost.LogManager, _appHost, _appHost.ServerConfigurationManager, _appHost.LocalizationManager);
|
||||||
|
_mainTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext();
|
||||||
Application.Run();
|
Application.Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,7 +325,14 @@ namespace MediaBrowser.ServerApplication
|
||||||
|
|
||||||
public static void Invoke(Action action)
|
public static void Invoke(Action action)
|
||||||
{
|
{
|
||||||
_serverNotifyIcon.Invoke(action);
|
if (_isRunningAsService)
|
||||||
|
{
|
||||||
|
action();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Task.Factory.StartNew(action, CancellationToken.None, TaskCreationOptions.None, _mainTaskScheduler ?? TaskScheduler.Current);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in a new issue