mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 05:38:06 -06:00
WebAPI: Add setComment endpoint
No UI implementation as of now. Closes #19598. PR #23031.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user