Represent by TorrentInfo only info-section related metadata

PR #21084.
This commit is contained in:
Vladimir Golovnev
2024-07-19 06:25:41 +03:00
committed by GitHub
parent 8b7fdf0f22
commit 3b38d0de7f
5 changed files with 23 additions and 164 deletions

View File

@@ -403,17 +403,27 @@ QString TorrentImpl::name() const
QDateTime TorrentImpl::creationDate() const
{
return m_torrentInfo.creationDate();
if (!hasMetadata())
return {};
const std::time_t date = nativeTorrentInfo()->creation_date();
return ((date != 0) ? QDateTime::fromSecsSinceEpoch(date) : QDateTime());
}
QString TorrentImpl::creator() const
{
return m_torrentInfo.creator();
if (!hasMetadata())
return {};
return QString::fromStdString(nativeTorrentInfo()->creator());
}
QString TorrentImpl::comment() const
{
return m_torrentInfo.comment();
if (!hasMetadata())
return {};
return QString::fromStdString(nativeTorrentInfo()->comment());
}
bool TorrentImpl::isPrivate() const