From 0f6499b3c72c15b39d22500a6d39a97b9ce1041d Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 1 Nov 2008 14:59:49 +0000 Subject: [PATCH] bah, futz with the remote strings a little more. --- daemon/remote.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index 9bb89f433..ce4883eb1 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -243,7 +243,7 @@ static const char * details_keys[] = { "peersConnected", "peersGettingFromUs", "peersSendingToUs", "pieceCount", "pieceSize", "rateDownload", "rateUpload", "recheckProgress", - "scrapeResponse", "seeders", "sizeWhenDone", + "scrapeResponse", "seeders", "sizeWhenDone", "startDate", "status", "timesCompleted", "totalSize", "uploadedEver", @@ -652,11 +652,16 @@ getStatusString( tr_benc * t, char * buf, size_t buflen ) tr_bencDictFindInt( t, "peersSendingToUs", &toUs ); if( fromUs && toUs ) tr_strlcpy( buf, "Up & Down", buflen ); - else if( fromUs ) - tr_strlcpy( buf, "Seeding", buflen ); else if( toUs ) tr_strlcpy( buf, "Downloading", buflen ); - else + else if( fromUs ) { + int64_t leftUntilDone = 0; + tr_bencDictFindInt( t, "leftUntilDone", &leftUntilDone ); + if( leftUntilDone > 0 ) + tr_strlcpy( buf, "Uploading", buflen ); + else + tr_strlcpy( buf, "Seeding", buflen ); + } else tr_strlcpy( buf, "Idle", buflen ); break; }