1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-28 02:27:41 +00:00

Merge pull request #1080 from guidocella/prefetch-magnet

Fetch metadata of stopped magnets
This commit is contained in:
Mitch Livingston 2021-08-22 19:30:30 -04:00 committed by GitHub
commit 17914bed2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View file

@ -344,7 +344,7 @@ void tr_torrentSetMetadataPiece(tr_torrent* tor, int piece, void const* data, in
tor->incompleteMetadata = NULL;
tor->isStopping = true;
tor->magnetVerify = true;
tor->startAfterVerify = true;
tor->startAfterVerify = !tor->prefetchMagnetMetadata;
tr_torrentMarkEdited(tor);
}
else /* drat. */

View file

@ -1020,8 +1020,16 @@ static void torrentInit(tr_torrent* tor, tr_ctor const* ctor)
if (isNewTorrent)
{
tor->startAfterVerify = doStart;
tr_torrentVerify(tor, NULL, NULL);
if (!tr_torrentHasMetadata(tor) && !doStart)
{
tor->prefetchMagnetMetadata = true;
tr_torrentStartNow(tor);
}
else
{
tor->startAfterVerify = doStart;
tr_torrentVerify(tor, NULL, NULL);
}
}
else if (doStart)
{
@ -2025,6 +2033,7 @@ void tr_torrentStop(tr_torrent* tor)
tor->isRunning = false;
tor->isStopping = false;
tor->prefetchMagnetMetadata = false;
tr_torrentSetDirty(tor);
tr_runInEventThread(tor->session, stopTorrent, tor);

View file

@ -241,6 +241,7 @@ struct tr_torrent
bool isDirty;
bool isQueued;
bool prefetchMagnetMetadata;
bool magnetVerify;
bool infoDictOffsetIsCached;