mirror of
https://github.com/transmission/transmission
synced 2025-02-02 12:32:54 +00:00
better way of storing if torrent was active
This commit is contained in:
parent
47f89dd773
commit
de3dc82ab2
1 changed files with 12 additions and 3 deletions
|
@ -126,9 +126,18 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
|||
fUseIncompleteFolder = NO;
|
||||
|
||||
[self setDownloadFolder: downloadFolder];
|
||||
|
||||
|
||||
//start transfer
|
||||
BOOL start = YES;
|
||||
NSNumber * active;
|
||||
NSString * paused;
|
||||
if (!(paused = [history objectForKey: @"Paused"]) || [paused isEqualToString: @"NO"])
|
||||
if ((active = [history objectForKey: @"Active"]))
|
||||
start = [active boolValue];
|
||||
else if ((paused = [history objectForKey: @"Paused"])) //old way of storing if active
|
||||
start = [paused isEqualToString: @"NO"];
|
||||
else;
|
||||
|
||||
if (start)
|
||||
{
|
||||
fStat = tr_torrentStat(fHandle);
|
||||
[self startTransfer];
|
||||
|
@ -144,7 +153,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
|||
[self hashString], @"TorrentHash",
|
||||
fDownloadFolder, @"DownloadFolder",
|
||||
[NSNumber numberWithBool: fUseIncompleteFolder], @"UseIncompleteFolder",
|
||||
[self isActive] ? @"NO" : @"YES", @"Paused",
|
||||
[NSNumber numberWithBool: [self isActive]], @"Active",
|
||||
[self date], @"Date",
|
||||
[NSNumber numberWithInt: fRatioSetting], @"RatioSetting",
|
||||
[NSNumber numberWithFloat: fRatioLimit], @"RatioLimit",
|
||||
|
|
Loading…
Reference in a new issue