1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-20 10:45:43 +00:00

calculate proper file progress for 0-byte files (fixes #2689)

This commit is contained in:
Mitchell Livingston 2009-12-25 16:56:33 +00:00
parent 8dbfb708f5
commit f6a5117ef9

View file

@ -1125,7 +1125,7 @@ tr_torrentFiles( const tr_torrent * tor,
for( i=0; i<n; ++i, ++walk ) {
const uint64_t b = isSeed ? tor->info.files[i].length : fileBytesCompleted( tor, i );
walk->bytesCompleted = b;
walk->progress = tr_getRatio( b, tor->info.files[i].length );
walk->progress = tor->info.files[i].length > 0.0 ? ( b / tor->info.files[i].length ) : 1.0;
}
if( fileCount )