Skip to content

Commit

Permalink
Merge branch 'qbittorrent:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
qBittUser authored Dec 24, 2024
2 parents c25451b + bbc3c28 commit 711e9cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 25 deletions.
18 changes: 3 additions & 15 deletions src/base/bittorrent/torrentimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2845,38 +2845,26 @@ QString TorrentImpl::createMagnetURI() const

const SHA1Hash infoHash1 = infoHash().v1();
if (infoHash1.isValid())
{
ret += u"xt=urn:btih:" + infoHash1.toString();
}

const SHA256Hash infoHash2 = infoHash().v2();
if (infoHash2.isValid())
if (const SHA256Hash infoHash2 = infoHash().v2(); infoHash2.isValid())
{
if (infoHash1.isValid())
ret += u'&';
ret += u"xt=urn:btmh:1220" + infoHash2.toString();
}

const QString displayName = name();
if (displayName != id().toString())
{
if (const QString displayName = name(); displayName != id().toString())
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));
}

for (const QUrl &urlSeed : asConst(urlSeeds()))
{
ret += u"&ws=" + QString::fromLatin1(urlSeed.toEncoded());
}
ret += u"&ws=" + urlSeed.toString(QUrl::FullyEncoded);

return ret;
}
Expand Down
20 changes: 10 additions & 10 deletions src/webui/www/private/scripts/dynamicTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,16 @@ window.qBittorrent.DynamicTable ??= (() => {
if ((brect.width - mouseXRelative) < 5) {
this.resizeTh = e.target;
this.canResize = true;
e.target.getParent("tr").style.cursor = "col-resize";
e.target.closest("tr").style.cursor = "col-resize";
}
else if ((mouseXRelative < 5) && e.target.getPrevious('[class=""]')) {
this.resizeTh = e.target.getPrevious('[class=""]');
this.canResize = true;
e.target.getParent("tr").style.cursor = "col-resize";
e.target.closest("tr").style.cursor = "col-resize";
}
else {
this.canResize = false;
e.target.getParent("tr").style.cursor = "";
e.target.closest("tr").style.cursor = "";
}
}
if (this.currentHeaderAction === "drag") {
Expand All @@ -215,7 +215,7 @@ window.qBittorrent.DynamicTable ??= (() => {
this.dropSide = "left";
}

e.target.getParent("tr").style.cursor = "move";
e.target.closest("tr").style.cursor = "move";

if (!previousVisibleSibling) { // right most column
borderChangeElement = e.target;
Expand Down Expand Up @@ -1949,14 +1949,14 @@ window.qBittorrent.DynamicTable ??= (() => {
if (value) {
td.textContent = "QBT_TR(Yes)QBT_TR[CONTEXT=SearchPluginsTable]";
td.title = "QBT_TR(Yes)QBT_TR[CONTEXT=SearchPluginsTable]";
td.getParent("tr").classList.add("green");
td.getParent("tr").classList.remove("red");
td.closest("tr").classList.add("green");
td.closest("tr").classList.remove("red");
}
else {
td.textContent = "QBT_TR(No)QBT_TR[CONTEXT=SearchPluginsTable]";
td.title = "QBT_TR(No)QBT_TR[CONTEXT=SearchPluginsTable]";
td.getParent("tr").classList.add("red");
td.getParent("tr").classList.remove("green");
td.closest("tr").classList.add("red");
td.closest("tr").classList.remove("green");
}
};
},
Expand Down Expand Up @@ -3294,7 +3294,7 @@ window.qBittorrent.DynamicTable ??= (() => {
break;
}
td.set({ "text": logLevel, "title": logLevel });
td.getParent("tr").className = `logTableRow${addClass}`;
td.closest("tr").className = `logTableRow${addClass}`;
};
},

Expand Down Expand Up @@ -3354,7 +3354,7 @@ window.qBittorrent.DynamicTable ??= (() => {
addClass = "peerBanned";
}
td.set({ "text": status, "title": status });
td.getParent("tr").className = `logTableRow${addClass}`;
td.closest("tr").className = `logTableRow${addClass}`;
};
},

Expand Down

0 comments on commit 711e9cf

Please sign in to comment.