mirror of
https://github.com/transmission/transmission
synced 2025-02-03 04:53:27 +00:00
(trunk daemon) #1819: indicate torrent error in transmission-remote -l
This commit is contained in:
parent
f404fcb4f9
commit
dfa9f075a4
1 changed files with 24 additions and 17 deletions
|
@ -272,6 +272,7 @@ static const char * details_keys[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char * list_keys[] = {
|
static const char * list_keys[] = {
|
||||||
|
"errorString",
|
||||||
"eta",
|
"eta",
|
||||||
"id",
|
"id",
|
||||||
"leftUntilDone",
|
"leftUntilDone",
|
||||||
|
@ -749,23 +750,29 @@ getStatusString( tr_benc * t, char * buf, size_t buflen )
|
||||||
|
|
||||||
case TR_STATUS_DOWNLOAD:
|
case TR_STATUS_DOWNLOAD:
|
||||||
case TR_STATUS_SEED: {
|
case TR_STATUS_SEED: {
|
||||||
int64_t fromUs = 0;
|
const char * err = NULL;
|
||||||
int64_t toUs = 0;
|
if( tr_bencDictFindStr( t, "errorString", &err ) )
|
||||||
tr_bencDictFindInt( t, "peersGettingFromUs", &fromUs );
|
tr_strlcpy( buf, err, buflen );
|
||||||
tr_bencDictFindInt( t, "peersSendingToUs", &toUs );
|
else {
|
||||||
if( fromUs && toUs )
|
int64_t fromUs = 0;
|
||||||
tr_strlcpy( buf, "Up & Down", buflen );
|
int64_t toUs = 0;
|
||||||
else if( toUs )
|
tr_bencDictFindInt( t, "peersGettingFromUs", &fromUs );
|
||||||
tr_strlcpy( buf, "Downloading", buflen );
|
tr_bencDictFindInt( t, "peersSendingToUs", &toUs );
|
||||||
else if( fromUs ) {
|
if( !fromUs && !toUs )
|
||||||
int64_t leftUntilDone = 0;
|
tr_strlcpy( buf, "Idle", buflen );
|
||||||
tr_bencDictFindInt( t, "leftUntilDone", &leftUntilDone );
|
else if( fromUs && toUs )
|
||||||
if( leftUntilDone > 0 )
|
tr_strlcpy( buf, "Up & Down", buflen );
|
||||||
tr_strlcpy( buf, "Uploading", buflen );
|
else if( toUs )
|
||||||
else
|
tr_strlcpy( buf, "Downloading", buflen );
|
||||||
tr_strlcpy( buf, "Seeding", buflen );
|
else if( fromUs ) {
|
||||||
} else
|
int64_t leftUntilDone = 0;
|
||||||
tr_strlcpy( buf, "Idle", buflen );
|
tr_bencDictFindInt( t, "leftUntilDone", &leftUntilDone );
|
||||||
|
if( leftUntilDone > 0 )
|
||||||
|
tr_strlcpy( buf, "Uploading", buflen );
|
||||||
|
else
|
||||||
|
tr_strlcpy( buf, "Seeding", buflen );
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue