From fe503631347c11bbb9ab4755fd1b49aded615c25 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Wed, 12 May 2021 07:43:50 -0500 Subject: [PATCH] Add option to remove torrent files to the torrent REST API --- services/torrent-rest/src/services/WebServer/routes/api.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/torrent-rest/src/services/WebServer/routes/api.ts b/services/torrent-rest/src/services/WebServer/routes/api.ts index 90b05c2..52737e1 100644 --- a/services/torrent-rest/src/services/WebServer/routes/api.ts +++ b/services/torrent-rest/src/services/WebServer/routes/api.ts @@ -71,9 +71,10 @@ export default function register(factory: RouteRegisterFactory { + let withData = (request.query)["with_data"] === "1"; let torrent = request.middlewareParams.torrent; try { - ipc.remove(torrent.infoHash); + ipc.remove(torrent.infoHash, withData); } catch(e) { if (e instanceof IpcConnectionError) { return respond(reply, Status.InternalServerError);