Changeset 14209


Ignore:
Timestamp:
Oct 20, 2013, 5:24:57 PM (9 years ago)
Author:
jordan
Message:

(trunk, libT) #5450: when starting torrents via RPC with torrent-start or torrent-start-now requests, work through the rpc-supplied torrent list in queue order

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpcimpl.c

    r14192 r14209  
    254254}
    255255
     256static int
     257compareTorrentByQueuePosition (const void * va, const void * vb)
     258{
     259  const tr_torrent * a = * (const tr_torrent **) va;
     260  const tr_torrent * b = * (const tr_torrent **) vb;
     261
     262  return a->queuePosition - b->queuePosition;
     263}
     264
    256265static const char*
    257266torrentStart (tr_session               * session,
     
    267276
    268277  torrents = getTorrents (session, args_in, &torrentCount);
     278  qsort (torrents, torrentCount, sizeof (tr_torrent *), compareTorrentByQueuePosition);
    269279  for (i=0; i<torrentCount; ++i)
    270280    {
     
    294304
    295305  torrents = getTorrents (session, args_in, &torrentCount);
     306  qsort (torrents, torrentCount, sizeof (tr_torrent *), compareTorrentByQueuePosition);
    296307  for (i=0; i<torrentCount; ++i)
    297308    {
Note: See TracChangeset for help on using the changeset viewer.