mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
parent
f2097dc4b5
commit
879c6bf9ff
1 changed files with 3 additions and 15 deletions
|
@ -2845,38 +2845,26 @@ QString TorrentImpl::createMagnetURI() const
|
||||||
|
|
||||||
const SHA1Hash infoHash1 = infoHash().v1();
|
const SHA1Hash infoHash1 = infoHash().v1();
|
||||||
if (infoHash1.isValid())
|
if (infoHash1.isValid())
|
||||||
{
|
|
||||||
ret += u"xt=urn:btih:" + infoHash1.toString();
|
ret += u"xt=urn:btih:" + infoHash1.toString();
|
||||||
}
|
|
||||||
|
|
||||||
const SHA256Hash infoHash2 = infoHash().v2();
|
if (const SHA256Hash infoHash2 = infoHash().v2(); infoHash2.isValid())
|
||||||
if (infoHash2.isValid())
|
|
||||||
{
|
{
|
||||||
if (infoHash1.isValid())
|
if (infoHash1.isValid())
|
||||||
ret += u'&';
|
ret += u'&';
|
||||||
ret += u"xt=urn:btmh:1220" + infoHash2.toString();
|
ret += u"xt=urn:btmh:1220" + infoHash2.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString displayName = name();
|
if (const QString displayName = name(); displayName != id().toString())
|
||||||
if (displayName != id().toString())
|
|
||||||
{
|
|
||||||
ret += u"&dn=" + QString::fromLatin1(QUrl::toPercentEncoding(displayName));
|
ret += u"&dn=" + QString::fromLatin1(QUrl::toPercentEncoding(displayName));
|
||||||
}
|
|
||||||
|
|
||||||
if (hasMetadata())
|
if (hasMetadata())
|
||||||
{
|
|
||||||
ret += u"&xl=" + QString::number(totalSize());
|
ret += u"&xl=" + QString::number(totalSize());
|
||||||
}
|
|
||||||
|
|
||||||
for (const TrackerEntryStatus &tracker : asConst(trackers()))
|
for (const TrackerEntryStatus &tracker : asConst(trackers()))
|
||||||
{
|
|
||||||
ret += u"&tr=" + QString::fromLatin1(QUrl::toPercentEncoding(tracker.url));
|
ret += u"&tr=" + QString::fromLatin1(QUrl::toPercentEncoding(tracker.url));
|
||||||
}
|
|
||||||
|
|
||||||
for (const QUrl &urlSeed : asConst(urlSeeds()))
|
for (const QUrl &urlSeed : asConst(urlSeeds()))
|
||||||
{
|
ret += u"&ws=" + urlSeed.toString(QUrl::FullyEncoded);
|
||||||
ret += u"&ws=" + QString::fromLatin1(urlSeed.toEncoded());
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue