mirror of
https://github.com/transmission/transmission
synced 2024-12-25 17:17:31 +00:00
fix: another piece priority fix (#2099)
move initialization to later in torrent construction so that we can correctly check whether the torrent is done or not
This commit is contained in:
parent
344ac056c8
commit
087a804b49
2 changed files with 2 additions and 3 deletions
|
@ -900,7 +900,7 @@ static uint64_t loadFromFile(tr_torrent* tor, uint64_t fieldsToLoad, bool* didRe
|
||||||
// Only load file priorities if we are actually downloading.
|
// Only load file priorities if we are actually downloading.
|
||||||
// If we're a seed or partial seed, loading it is a waste of time.
|
// If we're a seed or partial seed, loading it is a waste of time.
|
||||||
// NB: this is why loadProgress() comes before loadFilePriorities()
|
// NB: this is why loadProgress() comes before loadFilePriorities()
|
||||||
if (!tr_torrentIsSeed(tor) && (fieldsToLoad & TR_FR_FILE_PRIORITIES) != 0)
|
if ((tr_cpLeftUntilDone(&tor->completion) != 0) && (fieldsToLoad & TR_FR_FILE_PRIORITIES) != 0)
|
||||||
{
|
{
|
||||||
fieldsLoaded |= loadFilePriorities(&top, tor);
|
fieldsLoaded |= loadFilePriorities(&top, tor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -785,8 +785,6 @@ static void torrentInitFromInfo(tr_torrent* tor)
|
||||||
tr_cpConstruct(&tor->completion, tor);
|
tr_cpConstruct(&tor->completion, tor);
|
||||||
|
|
||||||
tr_torrentInitFilePieces(tor);
|
tr_torrentInitFilePieces(tor);
|
||||||
tor->completeness = tr_cpGetStatus(&tor->completion);
|
|
||||||
tr_torrentInitPiecePriorities(tor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tr_torrentFireMetadataCompleted(tr_torrent* tor);
|
static void tr_torrentFireMetadataCompleted(tr_torrent* tor);
|
||||||
|
@ -909,6 +907,7 @@ static void torrentInit(tr_torrent* tor, tr_ctor const* ctor)
|
||||||
|
|
||||||
tr_ctorInitTorrentPriorities(ctor, tor);
|
tr_ctorInitTorrentPriorities(ctor, tor);
|
||||||
tr_ctorInitTorrentWanted(ctor, tor);
|
tr_ctorInitTorrentWanted(ctor, tor);
|
||||||
|
tr_torrentInitPiecePriorities(tor);
|
||||||
|
|
||||||
refreshCurrentDir(tor);
|
refreshCurrentDir(tor);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue