mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 05:23:31 -07:00
root dir management is fully functional.
This commit is contained in:
parent
57bb6e1e01
commit
b50cd19add
5 changed files with 21 additions and 9 deletions
|
@ -16,17 +16,24 @@ namespace NzbDrone.Api.QualityProfiles
|
|||
|
||||
Get["/"] = x => GetRootFolders();
|
||||
Post["/"] = x => AddRootFolder();
|
||||
Delete["/{id}"] = x => DeleteRootFolder((int)x.id);
|
||||
}
|
||||
|
||||
private Response AddRootFolder()
|
||||
{
|
||||
_rootDirProvider.Add(Request.Body.FromJson<RootDir>());
|
||||
return new Response { StatusCode = HttpStatusCode.Created };
|
||||
var dir = _rootDirProvider.Add(Request.Body.FromJson<RootDir>());
|
||||
return dir.AsResponse(HttpStatusCode.Created);
|
||||
}
|
||||
|
||||
private Response GetRootFolders()
|
||||
{
|
||||
return _rootDirProvider.AllWithFreeSpace().AsResponse();
|
||||
}
|
||||
|
||||
private Response DeleteRootFolder(int folderId)
|
||||
{
|
||||
_rootDirProvider.Remove(folderId);
|
||||
return new Response { StatusCode = HttpStatusCode.OK };
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue