mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-06 23:52:31 -06:00
WebUI: Implement start torrents by category
This commit is contained in:
@@ -683,6 +683,17 @@ var TorrentsTable = new Class({
|
||||
return cnt;
|
||||
},
|
||||
|
||||
getFilteredTorrentsHashes : function (filterName, categoryHash) {
|
||||
var rowsHashes = [];
|
||||
var rows = this.rows.getValues();
|
||||
|
||||
for (i = 0; i < rows.length; i++)
|
||||
if (this.applyFilter(rows[i], filterName, categoryHash))
|
||||
rowsHashes.push(rows[i]['rowId']);
|
||||
|
||||
return rowsHashes;
|
||||
},
|
||||
|
||||
getFilteredAndSortedRows : function () {
|
||||
var filteredRows = new Array();
|
||||
|
||||
|
||||
@@ -385,6 +385,22 @@ initializeWindows = function() {
|
||||
setCategoryFilter(CATEGORIES_ALL);
|
||||
};
|
||||
|
||||
startTorrentsByCategoryFN = function (categoryHash) {
|
||||
var h = torrentsTable.getFilteredTorrentsHashes('all', categoryHash);
|
||||
if (h.length) {
|
||||
h.each(function (hash, index) {
|
||||
new Request({
|
||||
url: 'command/resume',
|
||||
method: 'post',
|
||||
data: {
|
||||
hash: hash
|
||||
}
|
||||
}).send();
|
||||
});
|
||||
updateMainData();
|
||||
}
|
||||
};
|
||||
|
||||
['pauseAll', 'resumeAll'].each(function(item) {
|
||||
addClickEvent(item, function(e) {
|
||||
new Event(e).stop();
|
||||
|
||||
Reference in New Issue
Block a user