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:
parent
8dbfb708f5
commit
f6a5117ef9
1 changed files with 1 additions and 1 deletions
|
@ -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 )
|
||||
|
|
Loading…
Add table
Reference in a new issue