mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Fix wrong "added on" date
This only happens for magnet links when its metadata has yet to be retrieved. Closes #11124.
This commit is contained in:
@@ -2028,6 +2028,11 @@ bool Session::addTorrent_impl(CreateTorrentParams params, const MagnetUri &magne
|
||||
p.upload_limit = params.uploadLimit;
|
||||
p.download_limit = params.downloadLimit;
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM >= 10200)
|
||||
if (params.addedTime.isValid())
|
||||
p.added_time = params.addedTime.toSecsSinceEpoch();
|
||||
#endif
|
||||
|
||||
// Preallocation mode
|
||||
p.storage_mode = isPreallocationEnabled()
|
||||
? lt::storage_mode_allocate : lt::storage_mode_sparse;
|
||||
@@ -4464,6 +4469,10 @@ namespace
|
||||
torrentParams.firstLastPiecePriority = fast.dict_find_int_value("qBt-firstLastPiecePriority");
|
||||
torrentParams.sequential = fast.dict_find_int_value("qBt-sequential");
|
||||
|
||||
const lt::bdecode_node addedTimeNode = fast.dict_find("qBt-addedTime");
|
||||
if (addedTimeNode.type() == lt::bdecode_node::int_t)
|
||||
torrentParams.addedTime = QDateTime::fromSecsSinceEpoch(addedTimeNode.int_value());
|
||||
|
||||
queuePos = fast.dict_find_int_value("qBt-queuePosition");
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user