From 9986236f2b4cfd9f671a3ed4da4fcf3f2fc3242c Mon Sep 17 00:00:00 2001 From: OldHawk Date: Sat, 13 Jan 2018 17:20:17 +0800 Subject: [PATCH] fix(torrents): check torrent status when user download a torrent --- .../torrents/server/controllers/torrents.server.controller.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js index 7ccd1614..85ec9576 100644 --- a/modules/torrents/server/controllers/torrents.server.controller.js +++ b/modules/torrents/server/controllers/torrents.server.controller.js @@ -513,6 +513,10 @@ exports.download = function (req, res) { return res.status(703).send({ message: 'SERVER.CAN_NOT_DOWNLOAD_IDLE' }); + } else if (req.torrent.torrent_status !== 'reviewed') { + return res.status(704).send({ + message: 'SERVER.TORRENT_STATUS_ERROR' + }); } else { fs.exists(filePath, function (exists) { if (exists) {