|
|
@ -71,9 +71,10 @@ export default function register(factory: RouteRegisterFactory<MiddlewareMethod< |
|
|
|
* Remove a torrent from the client |
|
|
|
*/ |
|
|
|
factory.delete("/remove/:torrentId", [torrent], async (request, reply) => { |
|
|
|
let withData = (<any>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); |
|
|
|