Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
check if progress is printed at least once
Browse files Browse the repository at this point in the history
  • Loading branch information
fent committed May 17, 2013
1 parent e0895a4 commit 189834d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,12 @@ exports.download = function(url, dest, args) {

youtubedl.on('exit', function() {
var averageSpeed = 0;
for (var i = 0, len = speed.length; i < len; i++) {
averageSpeed += speed[i];
if (speed.length) {
for (var i = 0, len = speed.length; i < len; i++) {
averageSpeed += speed[i];
}
averageSpeed /= len;
}
averageSpeed /= speed.length;

var timeTaken = Date.now() - start;
emitter.emit('end', {
Expand Down

0 comments on commit 189834d

Please sign in to comment.