fix(torrents): fixed the favorites of the torrent cannot be removed after the torrent was removed

This commit is contained in:
purebaba
2019-06-12 09:22:08 +08:00
parent e96e0fe57a
commit 76d8c1e7d5

View File

@@ -1530,6 +1530,10 @@ exports.delete = function (req, res) {
Subtitle.remove({
torrent: torrent._id
}).exec();
//remove all favorites of the torrent
Favorite.remove({
torrent: torrent._id
}).exec();
//update maker torrent count
if (torrent.maker) {
torrent.maker.update({