mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
webui (js): feature: Added complete support for labels (add/set/reset/display/filter) #648
Changes: - added list of labels on the lower-left corner - added support to add/set/reset labels on context menu - added support to filter torrents by label
This commit is contained in:
committed by
ngosang
parent
76d93c23b7
commit
4ae2f6c33b
@@ -39,6 +39,7 @@
|
||||
#include "core/preferences.h"
|
||||
#include "btjson.h"
|
||||
#include "prefjson.h"
|
||||
#include "jsonutils.h"
|
||||
#include "core/bittorrent/session.h"
|
||||
#include "core/bittorrent/trackerentry.h"
|
||||
#include "core/bittorrent/torrentinfo.h"
|
||||
@@ -677,8 +678,9 @@ void WebApplication::action_command_setLabel()
|
||||
if( m.contains("value") ) {
|
||||
QString label = m["value"].toString();
|
||||
if (!hash.isEmpty()) {
|
||||
QTorrentHandle h = QBtSession::instance()->getTorrentHandle(hash);
|
||||
QBtSession::instance()->setLabel(h, label);
|
||||
BitTorrent::TorrentHandle *const torrent = BitTorrent::Session::instance()->findTorrent(hash);
|
||||
if (torrent)
|
||||
torrent->setLabel(label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user