From c5a4a0db2cae5bfcb81cbc395f47fca49ef36aff Mon Sep 17 00:00:00 2001 From: qbittorrentfan <120124327+qbittorrentfan@users.noreply.github.com> Date: Sun, 25 Dec 2022 14:41:55 +0100 Subject: [PATCH] properties endpoint returns name/torrentID PR #18218. --- src/webui/api/torrentscontroller.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index 3d055a464..6ede337e5 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -388,6 +388,10 @@ void TorrentsController::infoAction() // - "save_path": Torrent save path // - "download_path": Torrent download path // - "comment": Torrent comment +// - "infohash_v1": Torrent v1 infohash (or empty string for v2 torrents) +// - "infohash_v2": Torrent v2 infohash (or empty string for v1 torrents) +// - "hash": Torrent TorrentID (infohashv1 for v1 torrents, truncated infohashv2 for v2/hybrid torrents) +// - "name": Torrent name void TorrentsController::propertiesAction() { requireParams({u"hash"_qs}); @@ -401,6 +405,8 @@ void TorrentsController::propertiesAction() dataDict[KEY_TORRENT_INFOHASHV1] = torrent->infoHash().v1().toString(); dataDict[KEY_TORRENT_INFOHASHV2] = torrent->infoHash().v2().toString(); + dataDict[KEY_TORRENT_NAME] = torrent->name(); + dataDict[KEY_TORRENT_ID] = torrent->id().toString(); dataDict[KEY_PROP_TIME_ELAPSED] = torrent->activeTime(); dataDict[KEY_PROP_SEEDING_TIME] = torrent->finishedTime(); dataDict[KEY_PROP_ETA] = static_cast(torrent->eta());