mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-26 20:11:49 +02:00
root dir management is fully functional.
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user