WebAPI: Add setComment endpoint

No UI implementation as of now.

Closes #19598.
PR #23031.
This commit is contained in:
HamletDuFromage
2025-08-04 11:52:54 +02:00
committed by GitHub
parent fef6ac515c
commit d7b330c069
10 changed files with 47 additions and 2 deletions

View File

@@ -367,6 +367,9 @@ TorrentImpl::TorrentImpl(SessionImpl *session, const lt::torrent_handle &nativeH
}
}
if (!params.comment.isEmpty())
m_comment = params.comment;
setStopCondition(params.stopCondition);
const auto *extensionData = static_cast<ExtensionData *>(m_ltAddTorrentParams.userdata);
@@ -440,6 +443,15 @@ QString TorrentImpl::comment() const
return m_comment;
}
void TorrentImpl::setComment(const QString &comment)
{
if (m_comment != comment)
{
m_comment = comment;
deferredRequestResumeData();
}
}
bool TorrentImpl::isPrivate() const
{
return m_torrentInfo.isPrivate();
@@ -2210,6 +2222,7 @@ void TorrentImpl::prepareResumeData(lt::add_torrent_params params)
.tags = m_tags,
.savePath = (!m_useAutoTMM ? m_savePath : Path()),
.downloadPath = (!m_useAutoTMM ? m_downloadPath : Path()),
.comment = m_comment,
.contentLayout = m_contentLayout,
.operatingMode = m_operatingMode,
.useAutoTMM = m_useAutoTMM,