Some more hardening
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
62fb3bb3ef
commit
b6c1f3fc6d
|
@ -1006,14 +1006,15 @@ OC.Uploader.prototype = _.extend({
|
||||||
bufferTotal = bufferTotal - (buffer[bufferIndex]) + remainingSeconds;
|
bufferTotal = bufferTotal - (buffer[bufferIndex]) + remainingSeconds;
|
||||||
buffer[bufferIndex] = remainingSeconds; //buffer to make it smoother
|
buffer[bufferIndex] = remainingSeconds; //buffer to make it smoother
|
||||||
bufferIndex = (bufferIndex + 1) % bufferSize;
|
bufferIndex = (bufferIndex + 1) % bufferSize;
|
||||||
bufferIndex2 = bufferIndex2++;
|
bufferIndex2++;
|
||||||
}
|
}
|
||||||
var smoothRemainingSeconds;
|
var smoothRemainingSeconds;
|
||||||
if(bufferIndex2<20) {
|
if (bufferIndex2 > 0 && bufferIndex2 < 20) {
|
||||||
smoothRemainingSeconds = bufferTotal / bufferIndex2;
|
smoothRemainingSeconds = bufferTotal / bufferIndex2;
|
||||||
}
|
} else if (bufferSize > 0) {
|
||||||
else {
|
|
||||||
smoothRemainingSeconds = bufferTotal / bufferSize;
|
smoothRemainingSeconds = bufferTotal / bufferSize;
|
||||||
|
} else {
|
||||||
|
smoothRemainingSeconds = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
var h = moment.duration(smoothRemainingSeconds, "seconds").humanize();
|
var h = moment.duration(smoothRemainingSeconds, "seconds").humanize();
|
||||||
|
|
Loading…
Reference in New Issue