mirror of
https://github.com/fergalmoran/Readarr.git
synced 2025-12-22 09:29:59 +00:00
New: Update Nancy to 2.0
This commit is contained in:
@@ -39,13 +39,13 @@ namespace Lidarr.Api.V1.System
|
||||
_configFileProvider = configFileProvider;
|
||||
_database = database;
|
||||
_lifecycleService = lifecycleService;
|
||||
Get["/status"] = x => GetStatus();
|
||||
Get["/routes"] = x => GetRoutes();
|
||||
Post["/shutdown"] = x => Shutdown();
|
||||
Post["/restart"] = x => Restart();
|
||||
Get("/status", x => GetStatus());
|
||||
Get("/routes", x => GetRoutes());
|
||||
Post("/shutdown", x => Shutdown());
|
||||
Post("/restart", x => Restart());
|
||||
}
|
||||
|
||||
private Response GetStatus()
|
||||
private object GetStatus()
|
||||
{
|
||||
return new
|
||||
{
|
||||
@@ -74,24 +74,24 @@ namespace Lidarr.Api.V1.System
|
||||
RuntimeVersion = _platformInfo.Version,
|
||||
RuntimeName = PlatformInfo.Platform,
|
||||
StartTime = _runtimeInfo.StartTime
|
||||
}.AsResponse();
|
||||
};
|
||||
}
|
||||
|
||||
private Response GetRoutes()
|
||||
private object GetRoutes()
|
||||
{
|
||||
return _routeCacheProvider.GetCache().Values.AsResponse();
|
||||
return _routeCacheProvider.GetCache().Values;
|
||||
}
|
||||
|
||||
private Response Shutdown()
|
||||
private object Shutdown()
|
||||
{
|
||||
Task.Factory.StartNew(() => _lifecycleService.Shutdown());
|
||||
return new { ShuttingDown = true }.AsResponse();
|
||||
return new { ShuttingDown = true };
|
||||
}
|
||||
|
||||
private Response Restart()
|
||||
private object Restart()
|
||||
{
|
||||
Task.Factory.StartNew(() => _lifecycleService.Restart());
|
||||
return new { Restarting = true }.AsResponse();
|
||||
return new { Restarting = true };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user