mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +08:00
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:
parent
8a44c1f6d5
commit
cc61ad01b6
@ -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);
|
||||
|
||||
|
@ -1804,8 +1804,6 @@ void TorrentImpl::prepareResumeData(const lt::add_torrent_params ¶ms)
|
||||
m_ltAddTorrentParams = params;
|
||||
}
|
||||
|
||||
m_ltAddTorrentParams.added_time = addedTime().toSecsSinceEpoch();
|
||||
|
||||
// We shouldn't save upload_mode flag to allow torrent operate normally on next run
|
||||
m_ltAddTorrentParams.flags &= ~lt::torrent_flags::upload_mode;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user