WebUI: Add multi-file renaming

PR #18287.
Closes #16239.
This commit is contained in:
loligans 2023-02-19 03:07:55 -08:00 committed by GitHub
parent d75fd3fcde
commit 466314675c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1340 additions and 28 deletions

View file

@ -362,6 +362,19 @@ window.qBittorrent.ContextMenu = (function() {
let show_seq_dl = true;
// hide renameFiles when more than 1 torrent is selected
if (h.length == 1) {
const data = torrentsTable.rows.get(h[0]).full_data;
let metadata_downloaded = !(data['state'] == 'metaDL' || data['state'] == 'forcedMetaDL' || data['total_size'] == -1);
// hide renameFiles when metadata hasn't been downloaded yet
metadata_downloaded
? this.showItem('renameFiles')
: this.hideItem('renameFiles');
}
else
this.hideItem('renameFiles');
if (!all_are_seq_dl && there_are_seq_dl)
show_seq_dl = false;