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 12, 2023
1 parent 39bd97f commit e3c2bd1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 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,16 @@ 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 +205,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 e3c2bd1

Please sign in to comment.