Fix some events

This commit is contained in:
Bryan Ashby 2019-01-17 21:27:25 -07:00
parent 39e7fe5d69
commit 2a3271ef4e
1 changed files with 10 additions and 6 deletions

View File

@ -34,14 +34,18 @@ module.exports = function systemEventUserLogInit(statLog) {
append(e, LogNames.Logoff, e.minutesOnline); append(e, LogNames.Logoff, e.minutesOnline);
}, },
[ systemEvents.UserUpload ] : (e) => { [ systemEvents.UserUpload ] : (e) => {
if(e.files.length) { // we can get here for dupe uploads
append(e, LogNames.UlFiles, e.files.length); append(e, LogNames.UlFiles, e.files.length);
const totalBytes = e.files.reduce( (bytes, fileEntry) => bytes + fileEntry.meta.byte_size, 0); const totalBytes = e.files.reduce( (bytes, fileEntry) => bytes + fileEntry.meta.byte_size, 0);
append(e, LogNames.UlFileBytes, totalBytes); append(e, LogNames.UlFileBytes, totalBytes);
}
}, },
[ systemEvents.UserDownload ] : (e) => { [ systemEvents.UserDownload ] : (e) => {
if(e.files.length) {
append(e, LogNames.DlFiles, e.files.length); append(e, LogNames.DlFiles, e.files.length);
const totalBytes = e.files.reduce( (bytes, fileEntry) => bytes + fileEntry.meta.byte_size, 0); const totalBytes = e.files.reduce( (bytes, fileEntry) => bytes + fileEntry.byteSize, 0);
append(e, LogNames.DlFileBytes, totalBytes); append(e, LogNames.DlFileBytes, totalBytes);
}
}, },
[ systemEvents.UserPostMessage ] : (e) => { [ systemEvents.UserPostMessage ] : (e) => {
append(e, LogNames.PostMessage, e.areaTag); append(e, LogNames.PostMessage, e.areaTag);