fix a display issue with the idle time for a split second after the transfer starts, since the transfer would be marked as downloading but would not yet have a start time

This commit is contained in:
Mitchell Livingston 2010-09-12 19:49:06 +00:00
parent 1c8be406c0
commit 9135d5e061
1 changed files with 2 additions and 2 deletions

View File

@ -771,7 +771,7 @@ torrentInit( tr_torrent * tor, const tr_ctor * ctor )
tor->bandwidth->priority = tr_ctorGetBandwidthPriority( ctor );
tor->error = TR_STAT_OK;
tor->finishedSeedingByIdle = FALSE;
tr_peerMgrAddTorrent( session->peerMgr, tor );
@ -1111,7 +1111,7 @@ tr_torrentStat( tr_torrent * tor )
s->doneDate = tor->doneDate;
s->startDate = tor->startDate;
if (s->activity == TR_STATUS_DOWNLOAD || s->activity == TR_STATUS_SEED)
if ((s->activity == TR_STATUS_DOWNLOAD || s->activity == TR_STATUS_SEED) && s->startDate != 0)
s->idleSecs = difftime(tr_time(), MAX(s->startDate, s->activityDate));
else
s->idleSecs = -1;