mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-07 17:32:20 +02:00
fix(core): fixed model.remove method with exec()
This commit is contained in:
@@ -327,7 +327,7 @@ exports.announce = function (req, res) {
|
||||
Peer.remove({
|
||||
torrent: req.torrent._id,
|
||||
_id: {$nin: req.torrent._peers}
|
||||
});
|
||||
}).exec();
|
||||
}
|
||||
|
||||
done(null);
|
||||
@@ -741,7 +741,7 @@ exports.announce = function (req, res) {
|
||||
$pull: {_peers: p._id}
|
||||
}).exec();
|
||||
|
||||
p.remove();
|
||||
p.remove().exec();
|
||||
mtDebug.debugGreen('---------------removePeer()----------------');
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ exports.delete = function (req, res) {
|
||||
//}).exec();
|
||||
torrent._subtitles.pull(r._id);
|
||||
|
||||
r.remove();
|
||||
r.remove().exec();
|
||||
res.json(torrent);
|
||||
|
||||
scoreUpdate(req, torrent.user, scoreConfig.action.uploadSubtitleBeDeleted);
|
||||
|
||||
@@ -799,7 +799,7 @@ exports.toggleHnRStatus = function (req, res) {
|
||||
removeTorrentHnRWarning(torrent._id);
|
||||
Complete.remove({
|
||||
torrent: torrent._id
|
||||
});
|
||||
}).exec();
|
||||
}
|
||||
|
||||
//add server message
|
||||
@@ -1199,11 +1199,11 @@ exports.delete = function (req, res) {
|
||||
//remove all peers of the torrent
|
||||
Peer.remove({
|
||||
torrent: torrent._id
|
||||
});
|
||||
}).exec();
|
||||
//remove all subtitle of the torrent
|
||||
Subtitle.remove({
|
||||
torrent: torrent._id
|
||||
});
|
||||
}).exec();
|
||||
//update maker torrent count
|
||||
if (torrent.maker) {
|
||||
torrent.maker.update({
|
||||
@@ -1220,7 +1220,7 @@ exports.delete = function (req, res) {
|
||||
removeTorrentHnRWarning(torrent._id);
|
||||
Complete.remove({
|
||||
torrent: torrent._id
|
||||
});
|
||||
}).exec();
|
||||
|
||||
torrent.remove(function (err) {
|
||||
if (err) {
|
||||
|
||||
Reference in New Issue
Block a user