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