Skip to content

Commit

Permalink
[WebUI] edit trackers for multiple torrents
Browse files Browse the repository at this point in the history
Signed-off-by: Xuefer H <[email protected]>
  • Loading branch information
xuefer committed Apr 11, 2023
1 parent 39bd97f commit eb418f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions deluge/ui/web/js/deluge-all/EditTrackersWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,12 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
});
}, this);

deluge.client.core.set_torrent_trackers(this.torrentId, trackers, {
failure: this.onSaveFail,
scope: this,
});
for (var i in this.torrentIds) {
deluge.client.core.set_torrent_trackers(this.torrentIds[i], trackers, {
failure: this.onSaveFail,
scope: this,
});
}

this.hide();
},
Expand All @@ -199,10 +201,13 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
}
},

show: function (ids) {
this.torrentIds = ids;
Deluge.EditTrackersWindow.superclass.show.call(this);
},
onShow: function () {
this.panel.getBottomToolbar().items.get(4).disable();
var r = deluge.torrents.getSelected();
this.torrentId = r.id;
deluge.client.core.get_torrent_status(r.id, ['trackers'], {
success: this.onRequestComplete,
scope: this,
Expand Down
2 changes: 1 addition & 1 deletion deluge/ui/web/js/deluge-all/Menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ deluge.menus = {
deluge.copyMagnetWindow.show();
break;
case 'edit_trackers':
deluge.editTrackers.show();
deluge.editTrackers.show(ids);
break;
case 'remove':
deluge.removeWindow.show(ids);
Expand Down

0 comments on commit eb418f5

Please sign in to comment.