Ignore:
Timestamp:
Apr 4, 2009, 5:29:08 AM (13 years ago)
Author:
charles
Message:

(trunk)

  1. add to the "recently-changed" torrent a list of recently-removed torrent ids.
  2. make the day-of-week alt speed a bitfield of days or'ed together, so that you can have (say) speed limits on monday and wednesday
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r8130 r8132  
    232232    if( toNextDay && (minutes < end) )
    233233        day = (day - 1) % 7;
    234    
    235     if( s->altSpeedTimeDay == TR_SCHED_ALL )
    236         return TRUE;
    237     else if( s->altSpeedTimeDay == TR_SCHED_WEEKDAY )
    238         return (day != 0) && day != 6;
    239     else if( s->altSpeedTimeDay == TR_SCHED_WEEKEND )
    240         return (day == 0) || (day == 6);
    241     else
    242         return day == s->altSpeedTimeDay;
     234
     235    return ((1<<day) & s->altSpeedTimeDay) != 0;
    243236}
    244237
     
    469462    session->tag = tr_strdup( tag );
    470463    session->magicNumber = SESSION_MAGIC_NUMBER;
     464    tr_bencInitList( &session->removedTorrents, 0 );
    471465
    472466    /* start the libtransmission thread */
     
    999993                day = (day - 1) % 7;
    1000994           
    1001             if( session->altSpeedTimeDay == TR_SCHED_ALL )
    1002                 isDay = TRUE;
    1003             else if( session->altSpeedTimeDay == TR_SCHED_WEEKDAY )
    1004                 isDay = (day != 0) && (day != 6);
    1005             else if( session->altSpeedTimeDay == TR_SCHED_WEEKEND )
    1006                 isDay = (day == 0) || (day == 6);
    1007             else
    1008                 isDay = day == session->altSpeedTimeDay;
     995            isDay = ((1<<day) & session->altSpeedTimeDay) != 0;
    1009996
    1010997            if( isDay )
     
    13961383
    13971384    /* free the session memory */
     1385    tr_bencFree( &session->removedTorrents );
    13981386    tr_bandwidthFree( session->bandwidth );
    13991387    tr_lockFree( session->lock );
Note: See TracChangeset for help on using the changeset viewer.