diff --git a/macosx/Torrent.m b/macosx/Torrent.m index ce107bcd1..0fa2c3511 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -1394,7 +1394,18 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 - (NSNumber *) progressSortKey { - return [NSNumber numberWithFloat: [self progress]]; + float progress; + if ((progress = [self progress]) >= 1.0) + { + float stopRatio, ratio; + if ((stopRatio = [self actualStopRatio]) == INVALID) + progress = 3.0; + else if (stopRatio > 0 && (ratio = [self ratio]) >= 0 && ratio <= stopRatio) + progress += ratio / stopRatio; + else; + } + + return [NSNumber numberWithFloat: progress]; } - (NSNumber *) ratioSortKey diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index 22b754d7b..673f41454 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -85,7 +85,8 @@ { float stopRatio, ratio; if ((stopRatio = [[info objectForKey: @"StopRatio"] floatValue]) != INVALID - && (ratio = [[info objectForKey: @"Ratio"] floatValue]) < stopRatio) + && (ratio = [[info objectForKey: @"Ratio"] floatValue]) < stopRatio + && stopRatio != 0) { if (ratio < 0) ratio = 0;