mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
When duplicate torrent is added set metadata to existing one
PR #17454. Closes #907.
This commit is contained in:
committed by
GitHub
parent
748226be29
commit
1c0479a795
@@ -2126,6 +2126,19 @@ lt::torrent_handle TorrentImpl::nativeHandle() const
|
||||
return m_nativeHandle;
|
||||
}
|
||||
|
||||
bool TorrentImpl::setMetadata(const TorrentInfo &torrentInfo)
|
||||
{
|
||||
if (hasMetadata())
|
||||
return false;
|
||||
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
return m_nativeHandle.set_metadata(torrentInfo.nativeInfo()->info_section());
|
||||
#else
|
||||
const std::shared_ptr<lt::torrent_info> nativeInfo = torrentInfo.nativeInfo();
|
||||
return m_nativeHandle.set_metadata(lt::span<const char>(nativeInfo->metadata().get(), nativeInfo->metadata_size()));
|
||||
#endif
|
||||
}
|
||||
|
||||
bool TorrentImpl::isMoveInProgress() const
|
||||
{
|
||||
return m_storageIsMoving;
|
||||
|
||||
Reference in New Issue
Block a user