mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-05 07:18:47 +01:00
Added is running as service to IServerApplicationHost
This commit is contained in:
@@ -179,10 +179,16 @@ namespace MediaBrowser.ServerApplication
|
||||
/// </summary>
|
||||
/// <param name="applicationPaths">The application paths.</param>
|
||||
/// <param name="logManager">The log manager.</param>
|
||||
public ApplicationHost(ServerApplicationPaths applicationPaths, ILogManager logManager)
|
||||
public ApplicationHost(ServerApplicationPaths applicationPaths, ILogManager logManager, bool isRunningAsService)
|
||||
: base(applicationPaths, logManager)
|
||||
{
|
||||
_isRunningAsService = isRunningAsService;
|
||||
}
|
||||
|
||||
private readonly bool _isRunningAsService;
|
||||
public bool IsRunningAsService
|
||||
{
|
||||
get { return _isRunningAsService; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -431,7 +437,7 @@ namespace MediaBrowser.ServerApplication
|
||||
await ItemRepository.Initialize().ConfigureAwait(false);
|
||||
|
||||
await ProviderRepository.Initialize().ConfigureAwait(false);
|
||||
|
||||
|
||||
((LibraryManager)LibraryManager).ItemRepository = ItemRepository;
|
||||
}
|
||||
|
||||
@@ -687,7 +693,8 @@ namespace MediaBrowser.ServerApplication
|
||||
WanAddress = GetWanAddress(),
|
||||
HasUpdateAvailable = _hasUpdateAvailable,
|
||||
SupportsAutoRunAtStartup = SupportsAutoRunAtStartup,
|
||||
TranscodingTempPath = ApplicationPaths.TranscodingTempPath
|
||||
TranscodingTempPath = ApplicationPaths.TranscodingTempPath,
|
||||
IsRunningAsService = IsRunningAsService
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace MediaBrowser.ServerApplication
|
||||
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
||||
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
||||
|
||||
_appHost = new ApplicationHost(appPaths, logManager);
|
||||
_appHost = new ApplicationHost(appPaths, logManager, runService);
|
||||
|
||||
_app = new App(_appHost, _appHost.LogManager.GetLogger("App"), runService);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user