Add eXact Length parameter when creating magnet URI

Include the `xl` (eXact Length) parameter in the magnet URI string inside the function `TorrentImpl::createMagnetURI()`.

Closes #20752.
PR #21958.
This commit is contained in:
antanilol 2024-12-08 20:29:41 +01:00 committed by GitHub
parent a311c259cc
commit 27451469fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2863,6 +2863,11 @@ QString TorrentImpl::createMagnetURI() const
ret += u"&dn=" + QString::fromLatin1(QUrl::toPercentEncoding(displayName));
}
if (hasMetadata())
{
ret += u"&xl=" + QString::number(totalSize());
}
for (const TrackerEntryStatus &tracker : asConst(trackers()))
{
ret += u"&tr=" + QString::fromLatin1(QUrl::toPercentEncoding(tracker.url));