Skip to content

Commit

Permalink
fix: Make smooth bitrate and remaining upload time work when unset
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Aug 21, 2023
1 parent 0609aee commit c87ce4b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/files/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -1264,10 +1264,10 @@ OC.Uploader.prototype = _.extend({
}
//console.log('#', ' idx: ',bufferIndex, ' Total: ', bufferTotal, ' remainSeconds: ', remainingSeconds, ' during: ', diffUpdate);

if (smoothRemainingSeconds === null) {
smoothRemainingSeconds = bufferTotal / bufferSize;
} else{
if (smoothRemainingSeconds) {
smoothRemainingSeconds = smoothing * (bufferTotal / bufferSize) + ((1-smoothing) * smoothRemainingSeconds);
} else {
smoothRemainingSeconds = bufferTotal / bufferSize;
}

if (bufferIndex % 4 === 0) {
Expand All @@ -1281,10 +1281,10 @@ OC.Uploader.prototype = _.extend({
}

// smooth bitrate
if (smoothBitrate === null) {
smoothBitrate = data.bitrate;
} else{
if (smoothBitrate) {
smoothBitrate = smoothing * data.bitrate + ((1-smoothing) * smoothBitrate);
} else {
smoothBitrate = data.bitrate;
}

self._setProgressBarText(h, h, t('files', '{loadedSize} of {totalSize} ({bitrate})' , {
Expand Down

0 comments on commit c87ce4b

Please sign in to comment.