]> source.dussan.org Git - nextcloud-server.git/commit
Fix upload remaining time and uploadrate value 5442/head
authorYaojin Qian <i@ume.ink>
Fri, 16 Jun 2017 14:03:28 +0000 (22:03 +0800)
committerYaojin Qian <i@ume.ink>
Fri, 16 Jun 2017 14:03:28 +0000 (22:03 +0800)
commitd41d48bd435a05a5132b86f1fc5b055e63c6e5f2
treece6fa3b219810b2af88a7b7f530dd99a92c59e5f
parent6ae58b6dcb5f8ba417585df42d60d83f0aa9421b
Fix upload remaining time and uploadrate value

1. The upload remaining time is always 'a few second' whatever a big or a
small file uploading.
This commit fixes it. The `new Date().getMilliseconds()` only return a
three digits number. When time arrived the next second, the millisecond
start from ZERO again. So `new Date().getTime()` is the righe choice.
And remaining time variables shoule be initialized when the file starts
uploading, otherwise the remaining time of a new upload will always be
'Infinity years' until you refresh the page.

2. The unit of `data.bitrate` is bit, but the argument unit of
`humanFileSize` function is byte, so it should be divided by 8.

Signed-off-by: Yaojin Qian <i@ume.ink>
apps/files/js/file-upload.js
core/vendor/core.js