New: Update Nancy to 2.0

This commit is contained in:
ta264
2019-09-12 21:32:51 +01:00
parent 425bd8964f
commit 17c9fc419c
44 changed files with 266 additions and 266 deletions

View File

@@ -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 };
}
}
}