* @param torrent The torrent whose tracker list is to be modified
* @param trackers An array of trackers, sorted by tier from first to last.
* NOTE: only the `tier' and `announce' fields are used.
- * libtransmission derives `scrape' from `announce'.
+ * libtransmission derives `scrape' from `announce'
+ * and reassigns 'id'.
* @param trackerCount size of the `trackers' array
*/
tr_bool
const int oldTrackerCount = fInfo->trackerCount;
tr_tracker_info * trackerStructs = tr_new(tr_tracker_info, oldTrackerCount+1);
for (NSUInteger i=0; i < oldTrackerCount; ++i)
- {
trackerStructs[i] = fInfo->trackers[i];
- trackerStructs[i].id = i;
- }
trackerStructs[oldTrackerCount].announce = (char *)[tracker UTF8String];
trackerStructs[oldTrackerCount].tier = trackerStructs[oldTrackerCount-1].tier + 1;
for (NSUInteger i = 0; i < fInfo->trackerCount; i++)
{
if (![removeIdentifiers containsIndex: fInfo->trackers[i].id])
- {
- trackerStructs[newCount] = fInfo->trackers[i];
- trackerStructs[newCount].id = newCount++;
- }
+ trackerStructs[newCount++] = fInfo->trackers[i];
}
const BOOL success = tr_torrentSetAnnounceList(fHandle, trackerStructs, newCount);