Browse Source

Don't miss to store metadata of new torrent

PR #18033.
adaptive-webui-19844
Vladimir Golovnev 2 years ago committed by GitHub
parent
commit
1cee69da6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/base/bittorrent/sessionimpl.cpp
  2. 4
      src/base/bittorrent/torrentimpl.cpp
  3. 2
      src/base/bittorrent/torrentimpl.h

2
src/base/bittorrent/sessionimpl.cpp

@ -5359,6 +5359,8 @@ TorrentImpl *SessionImpl::createTorrent(const lt::torrent_handle &nativeHandle, @@ -5359,6 +5359,8 @@ TorrentImpl *SessionImpl::createTorrent(const lt::torrent_handle &nativeHandle,
if (isRestored())
{
torrent->saveResumeData(lt::torrent_handle::save_info_dict);
// The following is useless for newly added magnet
if (torrent->hasMetadata())
{

4
src/base/bittorrent/torrentimpl.cpp

@ -690,9 +690,9 @@ bool TorrentImpl::needSaveResumeData() const @@ -690,9 +690,9 @@ bool TorrentImpl::needSaveResumeData() const
return m_nativeStatus.need_save_resume;
}
void TorrentImpl::saveResumeData()
void TorrentImpl::saveResumeData(lt::resume_data_flags_t flags)
{
m_nativeHandle.save_resume_data();
m_nativeHandle.save_resume_data(flags);
m_session->handleTorrentSaveResumeDataRequested(this);
}

2
src/base/bittorrent/torrentimpl.h

@ -245,7 +245,7 @@ namespace BitTorrent @@ -245,7 +245,7 @@ namespace BitTorrent
void handleStateUpdate(const lt::torrent_status &nativeStatus);
void handleCategoryOptionsChanged();
void handleAppendExtensionToggled();
void saveResumeData();
void saveResumeData(lt::resume_data_flags_t flags = {});
void handleMoveStorageJobFinished(const Path &path, bool hasOutstandingJob);
void fileSearchFinished(const Path &savePath, const PathList &fileNames);
void updatePeerCount(const QString &trackerURL, const TrackerEntry::Endpoint &endpoint, int count);

Loading…
Cancel
Save