mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-26 17:47:08 +00:00
37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using Nancy;
|
|
using NzbDrone.Common;
|
|
using NzbDrone.Api.Extensions;
|
|
|
|
namespace NzbDrone.Api.System
|
|
{
|
|
public class SystemModule : NzbDroneApiModule
|
|
{
|
|
private readonly IEnvironmentProvider _environmentProvider;
|
|
|
|
public SystemModule(IEnvironmentProvider environmentProvider)
|
|
: base("system")
|
|
{
|
|
_environmentProvider = environmentProvider;
|
|
Get["/status"] = x => GetStatus();
|
|
}
|
|
|
|
private Response GetStatus()
|
|
{
|
|
return new
|
|
{
|
|
Version = _environmentProvider.Version,
|
|
AppData = _environmentProvider.GetAppDataPath(),
|
|
IsAdmin = _environmentProvider.IsAdmin,
|
|
IsUserInteractive = _environmentProvider.IsUserInteractive,
|
|
BuildTime = _environmentProvider.BuildDateTime,
|
|
StartupPath = _environmentProvider.StartUpPath,
|
|
OsVersion = _environmentProvider.GetOsVersion(),
|
|
IsMono = EnvironmentProvider.IsMono,
|
|
IsProduction = EnvironmentProvider.IsProduction,
|
|
IsDebug = EnvironmentProvider.IsDebug,
|
|
IsLinux = EnvironmentProvider.IsLinux
|
|
}.AsResponse();
|
|
|
|
}
|
|
}
|
|
}
|