Add PackageUpdateMechanism to system/status response

This commit is contained in:
Mark McDowall 2018-11-25 14:40:53 -08:00 committed by Taloth Saldono
parent aafa9cb6be
commit 5a24b8d294
1 changed files with 7 additions and 3 deletions

View File

@ -20,6 +20,7 @@ namespace Sonarr.Api.V3.System
private readonly IConfigFileProvider _configFileProvider;
private readonly IMainDatabase _database;
private readonly ILifecycleService _lifecycleService;
private readonly IDeploymentInfoProvider _deploymentInfoProvider;
public SystemModule(IAppFolderInfo appFolderInfo,
IRuntimeInfo runtimeInfo,
@ -28,7 +29,8 @@ namespace Sonarr.Api.V3.System
IRouteCacheProvider routeCacheProvider,
IConfigFileProvider configFileProvider,
IMainDatabase database,
ILifecycleService lifecycleService)
ILifecycleService lifecycleService,
IDeploymentInfoProvider deploymentInfoProvider)
: base("system")
{
_appFolderInfo = appFolderInfo;
@ -39,6 +41,7 @@ namespace Sonarr.Api.V3.System
_configFileProvider = configFileProvider;
_database = database;
_lifecycleService = lifecycleService;
_deploymentInfoProvider = deploymentInfoProvider;
Get["/status"] = x => GetStatus();
Get["/routes"] = x => GetRoutes();
Post["/shutdown"] = x => Shutdown();
@ -71,7 +74,8 @@ namespace Sonarr.Api.V3.System
UrlBase = _configFileProvider.UrlBase,
RuntimeVersion = _platformInfo.Version,
RuntimeName = PlatformInfo.Platform,
StartTime = _runtimeInfo.StartTime
StartTime = _runtimeInfo.StartTime,
PackageUpdateMechanism = _deploymentInfoProvider.PackageUpdateMechanism
}.AsResponse();
}