Don't miss to store metadata of new torrent

PR #18033.
This commit is contained in:
Vladimir Golovnev 2022-11-19 13:33:38 +03:00 committed by GitHub
parent f54b66eb75
commit 1cee69da6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

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

View file

@ -690,9 +690,9 @@ bool TorrentImpl::needSaveResumeData() const
return m_nativeStatus.need_save_resume; 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); m_session->handleTorrentSaveResumeDataRequested(this);
} }

View file

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