mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-03 13:09:19 +01:00
fix(announce): fixed anounce score Math.around .toFixed(2)
This commit is contained in:
@@ -31,7 +31,7 @@ module.exports.announceLog = function (user, torrent, data) {
|
||||
log.curr_downloaded = data.curr_downloaded || 0;
|
||||
log.write_uploaded = data.write_uploaded || 0;
|
||||
log.write_downloaded = data.write_downloaded || 0;
|
||||
log.write_score = data.write_score.toFixed(2) || 0;
|
||||
log.write_score = data.write_score || 0;
|
||||
log.isVip = data.isVip || false;
|
||||
log.isUploader = data.isUploader || false;
|
||||
log.salesSettingValue = data.salesSettingValue || undefined;
|
||||
@@ -67,7 +67,7 @@ module.exports.announceLog = function (user, torrent, data) {
|
||||
$inc: {
|
||||
uploaded: data.write_uploaded,
|
||||
downloaded: data.write_downloaded,
|
||||
score: data.write_score.toFixed(2)
|
||||
score: data.write_score
|
||||
},
|
||||
updatedAt: Date.now()
|
||||
}, {
|
||||
@@ -118,6 +118,7 @@ module.exports.announceLog = function (user, torrent, data) {
|
||||
* @param score
|
||||
*/
|
||||
module.exports.scoreLog = function (user, score) {
|
||||
logger.info('score=' + score);
|
||||
//write userDaysLog
|
||||
var mom = moment().utcOffset(appConfig.dbTimeZone);
|
||||
var y = mom.get('year');
|
||||
@@ -131,7 +132,7 @@ module.exports.scoreLog = function (user, score) {
|
||||
date: d
|
||||
}, {
|
||||
$inc: {
|
||||
score: score.toFixed(2)
|
||||
score: score
|
||||
},
|
||||
updatedAt: Date.now()
|
||||
}, {
|
||||
@@ -158,7 +159,7 @@ module.exports.scoreLog = function (user, score) {
|
||||
month: m
|
||||
}, {
|
||||
$inc: {
|
||||
score: score.toFixed(2)
|
||||
score: score
|
||||
},
|
||||
updatedAt: Date.now()
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user