Explicitly set "added time" when adding new torrent

Don't overwrite "added time" with possibly incorrect value.
Explicitly set "added time" when adding new torrent.

PR #15644.
This commit is contained in:
Vladimir Golovnev 2021-10-31 12:08:19 +03:00 committed by GitHub
parent 8a44c1f6d5
commit cc61ad01b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -31,6 +31,7 @@
#include <algorithm>
#include <cstdint>
#include <ctime>
#include <queue>
#include <string>
#include <utility>
@ -2196,6 +2197,8 @@ bool Session::addTorrent_impl(const std::variant<MagnetUri, TorrentInfo> &source
else
p.flags |= lt::torrent_flags::auto_managed;
p.added_time = std::time(nullptr);
if (!isFindingIncompleteFiles)
return loadTorrent(loadTorrentParams);