From 9337815cdff53b8717c8d7fdea4d613b433341d1 Mon Sep 17 00:00:00 2001 From: Mark Yu Date: Sun, 13 Jul 2025 11:50:58 -0400 Subject: [PATCH] new share_action_limit json prop --- src/webui/api/serialize/serialize_torrent.cpp | 1 + src/webui/api/serialize/serialize_torrent.h | 1 + src/webui/api/synccontroller.cpp | 1 + src/webui/www/private/scripts/contextmenu.js | 1 + 4 files changed, 4 insertions(+) diff --git a/src/webui/api/serialize/serialize_torrent.cpp b/src/webui/api/serialize/serialize_torrent.cpp index 94c83a934..512818220 100644 --- a/src/webui/api/serialize/serialize_torrent.cpp +++ b/src/webui/api/serialize/serialize_torrent.cpp @@ -171,6 +171,7 @@ QVariantMap serialize(const BitTorrent::Torrent &torrent) {KEY_TORRENT_POPULARITY, torrent.popularity()}, {KEY_TORRENT_SEEDING_TIME_LIMIT, torrent.seedingTimeLimit()}, {KEY_TORRENT_INACTIVE_SEEDING_TIME_LIMIT, torrent.inactiveSeedingTimeLimit()}, + {KEY_TORRENT_SHARE_ACTION_LIMIT, static_cast(torrent.shareLimitAction())}, {KEY_TORRENT_LAST_SEEN_COMPLETE_TIME, Utils::DateTime::toSecsSinceEpoch(torrent.lastSeenComplete())}, {KEY_TORRENT_AUTO_TORRENT_MANAGEMENT, torrent.isAutoTMMEnabled()}, {KEY_TORRENT_TIME_ACTIVE, torrent.activeTime()}, diff --git a/src/webui/api/serialize/serialize_torrent.h b/src/webui/api/serialize/serialize_torrent.h index 438960e7f..257c718af 100644 --- a/src/webui/api/serialize/serialize_torrent.h +++ b/src/webui/api/serialize/serialize_torrent.h @@ -85,6 +85,7 @@ inline const QString KEY_TORRENT_MAX_INACTIVE_SEEDING_TIME = u"max_inactive_seed inline const QString KEY_TORRENT_RATIO_LIMIT = u"ratio_limit"_s; inline const QString KEY_TORRENT_SEEDING_TIME_LIMIT = u"seeding_time_limit"_s; inline const QString KEY_TORRENT_INACTIVE_SEEDING_TIME_LIMIT = u"inactive_seeding_time_limit"_s; +inline const QString KEY_TORRENT_SHARE_ACTION_LIMIT = u"share_action_limit"_s; inline const QString KEY_TORRENT_LAST_SEEN_COMPLETE_TIME = u"seen_complete"_s; inline const QString KEY_TORRENT_LAST_ACTIVITY_TIME = u"last_activity"_s; inline const QString KEY_TORRENT_TOTAL_SIZE = u"total_size"_s; diff --git a/src/webui/api/synccontroller.cpp b/src/webui/api/synccontroller.cpp index 469f58459..8d32d98a3 100644 --- a/src/webui/api/synccontroller.cpp +++ b/src/webui/api/synccontroller.cpp @@ -497,6 +497,7 @@ void SyncController::updateFreeDiskSpace(const qint64 freeDiskSpace) // - "max_seeding_time": Upload max seeding time // - "ratio_limit": Upload share ratio limit // - "seeding_time_limit": Upload seeding time limit +// - "share_action_limit": Action to execute when the limit is reached // - "seen_complete": Indicates the time when the torrent was last seen complete/whole // - "last_activity": Last time when a chunk was downloaded/uploaded // - "total_size": Size including unwanted data diff --git a/src/webui/www/private/scripts/contextmenu.js b/src/webui/www/private/scripts/contextmenu.js index 687a8c1cf..ac4e26f74 100644 --- a/src/webui/www/private/scripts/contextmenu.js +++ b/src/webui/www/private/scripts/contextmenu.js @@ -449,6 +449,7 @@ window.qBittorrent.ContextMenu ??= (() => { this.setEnabled("copyInfohash2", thereAreV2Hashes); const contextTagList = document.getElementById("contextTagList"); + for (const tag of tagMap.keys()) { const checkbox = contextTagList.querySelector(`a[href="#Tag/${tag}"] input[type="checkbox"]`); const count = tagCount.get(tag);