diff --git a/config/env/torrents.js b/config/env/torrents.js index dbccacde..dff5011d 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -29,7 +29,8 @@ module.exports = { userName: 'meanTorrent', realName: 'IRC announce client', channel: '#chdAnnounce', - msg_format: '%s upload torrent %s at %s', + default_msg_format: '%s upload - torrent: %s, type: %s, size: %d, sale: %s, at %s', + tvserial_msg_format: '%s upload - torrent: %s, type: %s, size: %d, seasons: %d, episodes: %s, sale: %s, at %s', showErrors: true, autoRejoin: true, autoConnect: true, diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js index c1763fdb..6d1c9c4e 100644 --- a/modules/torrents/server/controllers/torrents.server.controller.js +++ b/modules/torrents/server/controllers/torrents.server.controller.js @@ -570,11 +570,6 @@ exports.setRecommendLevel = function (req, res) { }); } }); - - var client = req.app.get('ircClient'); - var msg = vsprintf(ircConfig.msg_format, [torrent.user.displayName, torrent.torrent_filename, moment().format('YYYY-MM-DD HH:mm:ss')]); - client.notice(ircConfig.channel, msg); - } else { return res.status(422).send({ message: 'params rlevel error' @@ -601,6 +596,33 @@ exports.setReviewedStatus = function (req, res) { } else { res.json(torrent); + //irc announce + var msg = ''; + var client = req.app.get('ircClient'); + + if (torrent.torrent_type === 'tvserial') { + msg = vsprintf(ircConfig.tvserial_msg_format, [ + torrent.user.displayName, + torrent.torrent_filename, + torrent.torrent_type, + torrent.torrent_size, + torrent.torrent_seasons, + torrent.torrent_episodes, + torrent.torrent_sale_status, + moment().format('YYYY-MM-DD HH:mm:ss') + ]); + } else { + msg = vsprintf(ircConfig.default_msg_format, [ + torrent.user.displayName, + torrent.torrent_filename, + torrent.torrent_type, + torrent.torrent_size, + torrent.torrent_sale_status, + moment().format('YYYY-MM-DD HH:mm:ss') + ]); + } + client.notice(ircConfig.channel, msg); + //create trace log traceLogCreate(req, traceConfig.action.AdminTorrentSetReviewedStatus, { torrent: torrent._id,