when sorting by progress, if seeding, sort by progress towards meeting set ratio
This commit is contained in:
parent
eab0827294
commit
2f8eb2edb9
|
@ -1394,7 +1394,18 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
|
|
||||||
- (NSNumber *) progressSortKey
|
- (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
|
- (NSNumber *) ratioSortKey
|
||||||
|
|
|
@ -85,7 +85,8 @@
|
||||||
{
|
{
|
||||||
float stopRatio, ratio;
|
float stopRatio, ratio;
|
||||||
if ((stopRatio = [[info objectForKey: @"StopRatio"] floatValue]) != INVALID
|
if ((stopRatio = [[info objectForKey: @"StopRatio"] floatValue]) != INVALID
|
||||||
&& (ratio = [[info objectForKey: @"Ratio"] floatValue]) < stopRatio)
|
&& (ratio = [[info objectForKey: @"Ratio"] floatValue]) < stopRatio
|
||||||
|
&& stopRatio != 0)
|
||||||
{
|
{
|
||||||
if (ratio < 0)
|
if (ratio < 0)
|
||||||
ratio = 0;
|
ratio = 0;
|
||||||
|
|
Loading…
Reference in New Issue