Changeset 2082


Ignore:
Timestamp:
Jun 15, 2007, 12:15:39 AM (15 years ago)
Author:
charles
Message:

tr_getFinished() returns :)

Location:
branches/file_selection
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/file_selection/cli/transmissioncli.c

    r2079 r2082  
    9292    tr_stat_t    * s;
    9393    tr_handle_status_t * hstat;
    94     cp_status_t cpPrevStatus = TR_CP_INCOMPLETE;
    9594
    9695    printf( "Transmission %s (%d) - http://transmission.m0k.org/\n\n",
     
    284283            fprintf( stderr, "\n" );
    285284        }
    286        
    287         if( cpPrevStatus != s->cpStatus )
    288         {
    289             if( s->cpStatus == TR_CP_COMPLETE )
    290                 result = system(finishCall);
    291 
    292             cpPrevStatus = s->cpStatus;
     285       
     286        if( tr_getFinished( tor ) )
     287        {
     288            result = system(finishCall);
    293289        }
    294290    }
  • branches/file_selection/libtransmission/internal.h

    r2079 r2082  
    176176    int               error;
    177177    char              errorString[128];
     178    int               finished;
    178179
    179180    char            * id;
  • branches/file_selection/libtransmission/torrent.c

    r2079 r2082  
    173173    tor->key      = h->key;
    174174    tor->azId     = h->azId;
     175    tor->finished = 0;
    175176
    176177    /* Escaped info hash for HTTP queries */
     
    375376
    376377    tr_lockUnlock( &tor->lock );
     378}
     379
     380int tr_getFinished( tr_torrent_t * tor )
     381{
     382    if( tor->finished )
     383    {
     384        tor->finished = 0;
     385        return 1;
     386    }
     387    return 0;
    377388}
    378389
     
    958969            }
    959970
     971            tor->finished = cpState != TR_CP_INCOMPLETE;
     972
    960973            if( cpState == TR_CP_COMPLETE )
    961974                tr_trackerCompleted( tor->tracker );
  • branches/file_selection/libtransmission/transmission.h

    r2079 r2082  
    339339
    340340/***********************************************************************
     341 * tr_getFinished
     342 ***********************************************************************
     343 * The first call after a torrent is completed returns 1. Returns 0
     344 * in other cases.
     345 **********************************************************************/
     346int tr_getFinished( tr_torrent_t * );
     347
     348
     349/***********************************************************************
    341350 * tr_manualUpdate
    342351 ***********************************************************************
Note: See TracChangeset for help on using the changeset viewer.