From ee37f1db3d48ab57d497d432299bf3dfd16a23b6 Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Mon, 27 Nov 2017 00:21:19 -0500 Subject: [PATCH] Add Tags columns --- src/webui/btjson.cpp | 2 ++ src/webui/www/public/scripts/dynamicTable.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/webui/btjson.cpp b/src/webui/btjson.cpp index 12140902f..5979aede3 100644 --- a/src/webui/btjson.cpp +++ b/src/webui/btjson.cpp @@ -94,6 +94,7 @@ static const char KEY_TORRENT_STATE[] = "state"; static const char KEY_TORRENT_SEQUENTIAL_DOWNLOAD[] = "seq_dl"; static const char KEY_TORRENT_FIRST_LAST_PIECE_PRIO[] = "f_l_piece_prio"; static const char KEY_TORRENT_CATEGORY[] = "category"; +static const char KEY_TORRENT_TAGS[] = "tags"; static const char KEY_TORRENT_SUPER_SEEDING[] = "super_seeding"; static const char KEY_TORRENT_FORCE_START[] = "force_start"; static const char KEY_TORRENT_SAVE_PATH[] = "save_path"; @@ -370,6 +371,7 @@ namespace if (torrent->hasMetadata()) ret[KEY_TORRENT_FIRST_LAST_PIECE_PRIO] = torrent->hasFirstLastPiecePriority(); ret[KEY_TORRENT_CATEGORY] = torrent->category(); + ret[KEY_TORRENT_TAGS] = torrent->tags().toList().join(", "); ret[KEY_TORRENT_SUPER_SEEDING] = torrent->superSeeding(); ret[KEY_TORRENT_FORCE_START] = torrent->isForced(); ret[KEY_TORRENT_SAVE_PATH] = Utils::Fs::toNativePath(torrent->savePath()); diff --git a/src/webui/www/public/scripts/dynamicTable.js b/src/webui/www/public/scripts/dynamicTable.js index 0ecb8bd5f..c6e62058c 100644 --- a/src/webui/www/public/scripts/dynamicTable.js +++ b/src/webui/www/public/scripts/dynamicTable.js @@ -743,6 +743,7 @@ var TorrentsTable = new Class({ this.newColumn('eta', '', 'QBT_TR(ETA)QBT_TR[CONTEXT=TorrentModel]', 100, true); this.newColumn('ratio', '', 'QBT_TR(Ratio)QBT_TR[CONTEXT=TorrentModel]', 100, true); this.newColumn('category', '', 'QBT_TR(Category)QBT_TR[CONTEXT=TorrentModel]', 100, true); + this.newColumn('tags', '', 'QBT_TR(Tags)QBT_TR[CONTEXT=TorrentModel]', 100, true); this.newColumn('added_on', '', 'QBT_TR(Added On)QBT_TR[CONTEXT=TorrentModel]', 100, true); this.newColumn('completion_on', '', 'QBT_TR(Completed On)QBT_TR[CONTEXT=TorrentModel]', 100, false); this.newColumn('tracker', '', 'QBT_TR(Tracker)QBT_TR[CONTEXT=TorrentModel]', 100, false); @@ -961,6 +962,9 @@ var TorrentsTable = new Class({ td.set('html', html); }; + // tags + this.columns['tags'].updateTd = this.columns['name'].updateTd; + // added on this.columns['added_on'].updateTd = function (td, row) { var date = new Date(this.getRowValue(row) * 1000).toLocaleString();