fix(torrents): check torrent status when user download a torrent

This commit is contained in:
OldHawk
2018-01-13 17:20:17 +08:00
parent 6cdef04bf9
commit 9986236f2b

View File

@@ -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) {