Add ability to display torrent "privateness" in UI

PR #20951.

---------

Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
Co-authored-by: Vladimir Golovnev <glassez@yandex.ru>
Co-authored-by: thalieht <thalieht@users.noreply.github.com>
This commit is contained in:
ManiMatter
2024-07-07 18:09:57 +02:00
committed by GitHub
parent a4f63a5c30
commit 87a202c71e
13 changed files with 183 additions and 85 deletions

View File

@@ -70,6 +70,7 @@ window.qBittorrent.PropGeneral = (function() {
$("torrent_hash_v2").set("html", "");
$("save_path").set("html", "");
$("comment").set("html", "");
$("private").set("html", "");
piecesBar.clear();
};
@@ -210,6 +211,15 @@ window.qBittorrent.PropGeneral = (function() {
$("save_path").set("html", data.save_path);
$("comment").set("html", window.qBittorrent.Misc.parseHtmlLinks(window.qBittorrent.Misc.escapeHtml(data.comment)));
if (data.has_metadata) {
$("private").set("text", (data.private
? "QBT_TR(Yes)QBT_TR[CONTEXT=PropertiesWidget]"
: "QBT_TR(No)QBT_TR[CONTEXT=PropertiesWidget]"));
}
else {
$("private").set("text", "QBT_TR(N/A)QBT_TR[CONTEXT=PropertiesWidget]");
}
}
else {
clearData();