mirror of
https://github.com/transmission/transmission
synced 2025-02-03 21:12:05 +00:00
revise tr_torrentSetFilePriorities() for BMW
This commit is contained in:
parent
6f09fbe18d
commit
a3eb718162
2 changed files with 14 additions and 7 deletions
|
@ -1160,12 +1160,16 @@ tr_torrentSetFilePriority( tr_torrent_t * tor,
|
|||
}
|
||||
|
||||
void
|
||||
tr_torrentSetFilePriorities( tr_torrent_t * tor,
|
||||
const tr_priority_t * filePriorities )
|
||||
tr_torrentSetFilePriorities( tr_torrent_t * tor,
|
||||
int * files,
|
||||
int fileCount,
|
||||
tr_priority_t priority )
|
||||
{
|
||||
int i;
|
||||
for( i=0; i<tor->info.pieceCount; ++i )
|
||||
tr_torrentSetFilePriorityImpl( tor, i, filePriorities[i], FALSE );
|
||||
for( i=0; i<fileCount; ++i ) {
|
||||
const int fileIndex = files[i];
|
||||
tr_torrentSetFilePriorityImpl( tor, fileIndex, priority, FALSE );
|
||||
}
|
||||
fastResumeSave( tor );
|
||||
}
|
||||
|
||||
|
|
|
@ -213,9 +213,12 @@ enum
|
|||
|
||||
typedef int8_t tr_priority_t;
|
||||
|
||||
/* priorities should be an array of tor->info.fileCount bytes,
|
||||
* each holding a value of TR_PRI_NORMAL, _HIGH, or _LOW */
|
||||
void tr_torrentSetFilePriorities ( tr_torrent_t *, const tr_priority_t * priorities );
|
||||
/* set a batch of files to a particular priority. */
|
||||
void tr_torrentSetFilePriorities( tr_torrent_t * tor,
|
||||
int * files,
|
||||
int fileCount,
|
||||
tr_priority_t priority );
|
||||
|
||||
|
||||
/* single-file form of tr_torrentPrioritizeFiles.
|
||||
* priority must be one of TR_PRI_NORMAL, _HIGH, or _LOW */
|
||||
|
|
Loading…
Reference in a new issue