From f6b456b7c3670c1e4596c7dcae85e55d4b0fcb87 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Thu, 28 Sep 2006 17:38:10 +0000 Subject: [PATCH] hopefully a bit better...now just figure out a way to get the progress before starting a torrent --- macosx/Torrent.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 550792885..3773b684a 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -423,10 +423,11 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 * volume = [[[NSFileManager defaultManager] componentsToDisplayForPath: location] objectAtIndex: 0]; NSDictionary * fsAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath: location]; uint64_t remainingSpace = [[fsAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue], - torrentRemaining = [self size] * (uint64_t)(1.0 - [self progress]); + torrentRemaining = [self size] - (uint64_t)[self downloadedValid]; NSLog(@"Volume: %@", volume); NSLog(@"Remaining disk space: %qu (%@)", remainingSpace, [NSString stringForFileSize: remainingSpace]); + NSLog(@"Torrent total size: %qu (%@)", [self size], [NSString stringForFileSize: [self size]]); NSLog(@"Torrent remaining size: %qu (%@)", torrentRemaining, [NSString stringForFileSize: torrentRemaining]); if (volume && remainingSpace <= torrentRemaining)